Coder Social home page Coder Social logo

chineseholiday's People

Contributors

crazysiri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chineseholiday's Issues

报这个错误是什么问题

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.

启动报错

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目录下有一年的数据,通过这个数据就可以实现离线判断,会更稳定些。可否对相关逻辑进行优化,使用这个相当于离线的版本来判断节假日。

希望生日提醒显示为:某某79岁生日

希望生日提醒增加年纪提醒,例如某某79岁生日。因为真记不住长辈多少岁数了。我自己多少岁也是稀里糊涂的,恳请大神实现这个需求,谢谢!设置的是时候只要设置出生日子,这样结婚纪念日等类似的可以通用

Sensor 离线

今天闹钟没响, 发现是 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也不行,下面纪念日倒计时时间秒是静止不动的,不知道是啥子原因,请教下大佬

卡片和 calculate_age 出错

楼主, 卡片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结婚两周年'

加一个binary sensor支持ios用户假期自动跳过闹钟?

背景: 目前的sensor不支持homekit bridge直接读取是否是假期的信息。但是目前有绕过方案,可以建一个input boolean辅助元素,定时同步状态。
IMG_1066

Ios跳过假期闹钟的思路是这样的,
1,加一个binary sensor
2,把binary sensor用homekit bridge映射到homekit
3,ios加一个快捷指令,凌晨定时执行,跳过假期闹钟
IMG_1065

各位有没有碰到卡片加载不了的问题

卡加加载不上,提示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

能否支持自定义假期?

有的时候公司的假期和法定假期稍微有点不一样,希望可以支持手动设置某几个日期为假日或工作日。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.