crazysiri / chineseholiday Goto Github PK
View Code? Open in Web Editor NEWChinese holiday custom component for homeassistant
Chinese holiday custom component for homeassistant
Logger: frontend.js.latest.202204050
Source: components/system_log/init.py:190
First occurred: 15:47:27 (27 occurrences)
Last logged: 16:19:23
http://xxxxxxxx/local/custom-lovelace/ch_calendar-card/ch_calendar-card.js:250:19 Uncaught TypeError: Cannot read properties of undefined (reading 'term')
http://xxxxxx/local/community/lovelace-animated-background/animated-background.js:535:22 Uncaught TypeError: Cannot read properties of null (reading 'background')
http://xxxxxxx/local/community/lovelace-animated-background/animated-background.js:535:22 Uncaught TypeError: Cannot read property 'background' of null
:0:0 Script error.
如题
No 'version' key in the manifest file for custom integration 'chineseholiday'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'chineseholiday
HA为最新版本, Docker中运行, 报错如下, 实体未显示
2023-01-04 21:57:08.403 ERROR (MainThread) [homeassistant.components.sensor] chineseholiday: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 493, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 715, in async_device_update
await task
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/util/init.py", line 192, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/chineseholiday/sensor.py", line 547, in _update
nearest = self.nearest_holiday()
File "/config/custom_components/chineseholiday/sensor.py", line 482, in nearest_holiday
results = self._holiday.getHoliday()
File "/config/custom_components/chineseholiday/holiday.py", line 387, in getHoliday
list = self.getholidayForNMonths()
File "/config/custom_components/chineseholiday/holiday.py", line 424, in getholidayForNMonths
results = self.getonline40dholiday('101010100',str(y),"{:0>2d}".format(m))
File "/config/custom_components/chineseholiday/holiday.py", line 441, in getonline40dholiday
list = json.loads(json_str)
File "/usr/local/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
目前是否是节假日,是通过api接口获取的。其实api接口的作者,提供了开源版本的实现。在data目录下有一年的数据,通过这个数据就可以实现离线判断,会更稳定些。可否对相关逻辑进行优化,使用这个相当于离线的版本来判断节假日。
主要是为了提前获取明天是否工作日的属性, 来显示闹钟的状态。
- bb生日 #卡片前端aa生日(1岁)这个是用那个计算出来的?结婚日期?
希望生日提醒增加年纪提醒,例如某某79岁生日。因为真记不住长辈多少岁数了。我自己多少岁也是稀里糊涂的,恳请大神实现这个需求,谢谢!设置的是时候只要设置出生日子,这样结婚纪念日等类似的可以通用
今天闹钟没响, 发现是 sensor 离线了好一会.. 我没用默认的 card 来显示,只是用了里面的属性值来控制。
Logger: homeassistant.util.async_
Source: util/async_.py:132
First occurred: May 29, 2021, 12:00:15 AM (3 occurrences)
Last logged: 12:00:15 AM
Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for chineseholiday doing I/O at custom_components/chineseholiday/holiday.py, line 428: res = self.session.get(url, headers=headers)
大佬,我HA中所有的传感器都写在另一个YAML文件中,所以您让写在configuration.yaml中的,我也只能写在另一个文件了,重启HA后,传感器也建立成功,一切看似正常了,但第二天日期不更新了,比如昨天距A生日还有8天,今天还是8天,这距离时间感觉不跳了,重启HA也不行,下面纪念日倒计时时间秒是静止不动的,不知道是啥子原因,请教下大佬
2021-06-20 16:12:10 ERROR (MainThread) [frontend.js.latest.202106030] http://192.168.1.2:8123/local/custom-lovelace/ch_calendar-card/ch_calendar-card.js:299:38 Uncaught TypeError: Cannot read property 'length' of undefined
按错误提示好像是 future_dates.length 没有定义?
就是下面通知 test这段代码放啥地方啊?
test:
sequence:
- service: notify.mobile_app_xxx
data_template:
title: "节假日提醒"
message: "{{ message }}"
做了自动转换吗?我录入进去农历生日:10月16
展示出来变成XX农历生日2024年11月16
这种是什么情况?
楼主, 卡片GitHub提示Uncaught TypeError: Cannot read property 'length' of undefined提示这个属性错误了.
另外,
参考配置里面, 这部分有问题.
calculate_age:
- date: '2022-10-10 10:23:10'
name: 'aa和bb结婚两周年'
提示这样错误.
duplicated mapping key at line 128, column 8:
name: 'aa和bb结婚两周年'
WARNING: Polymer will be removed from window in Home Assistant 2023.5. More info: https://developers.home-assistant.io/blog/2023/04/04/deprecating_polymer
卡加加载不上,提示Custom element doesn't exist: ch_calendar-card.
反复检查找不到错误,ui-lovelace.yaml 加载的其它卡片正常,路径配置没错误
还有一个奇怪的问题:
通过samba 挂载的HASS目录,在共享目录里建不了icons 这个目录,换了两台电脑都是这样,感觉又像WINDOWS的问题。
我把目录改名为icon后上传,然后Terminal进去 创建icons目录,把文件复制过去,ls看目录和文件正常了,回到win中看不到这个目录
notify_principles:
'14|7|3|1':
- date: "0101"
solar: False
- date: "0102"
'3':
- name: "xx结婚纪念日"
请问 - name: "xx结婚纪念日" 这样写能成功提醒吗?
ps:这个"xx结婚纪念日" 已经在上面通过 solar_anniversary: 定义过了
节日 和 节气 每天有显示着上一次更新的。直到下个 节日 或 节气来到才更新,然后又再一直显示着直到下一个更新。
我觉得 节日 和 节气 应该是在当天显示而已,然后隔天就需要没有显示才对。
麻烦你检查一下。
目前HA版本是2023.2.1
生日设置的20120506 今年2023年 显示距10岁生日还有XXX天,应该是11岁啊
卡片怎么使用
农历11月29日的生日无法在卡片中显示,请大佬看一下
有的时候公司的假期和法定假期稍微有点不一样,希望可以支持手动设置某几个日期为假日或工作日。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.