xiaoguaileo 发表于 2020-2-2 16:48:11

docker下面安装的homeassistant里安装后报错
报错信息如下:
2020-02-02 16:47:10 ERROR (MainThread) chineseholiday: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 299, in _async_add_entity
    await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
File "/config/custom_components/chineseholiday/sensor.py", line 260, in _update
    key,days,annis = self.calculate_anniversary()
File "/config/custom_components/chineseholiday/sensor.py", line 146, in calculate_anniversary
    month = int(date_str[:2])
ValueError: invalid literal for int() with base 10: '“0'

crazysiri 发表于 2020-2-2 23:00:20

xiaoguaileo 发表于 2020-2-2 16:48
docker下面安装的homeassistant里安装后报错
报错信息如下:
2020-02-02 16:47:10 ERROR (MainThread)

配置相关参数发一下

crazysiri 发表于 2020-2-5 15:23:11

新鲜出炉,加了个可以实现节假日提醒的功能,有需要的朋友请更新

xiaoguaileo 发表于 2020-2-6 10:29:53

crazysiri 发表于 2020-2-2 23:00
配置相关参数发一下

插件安装路径,/配置文件主目录/custom_components/chineseholiday/ 文件都放在这里

yaml配置

sensor:
- platform: chineseholiday
    name: holiday
    solar_anniversary:
      - "0703#DD阳历生日#"
    lunar_anniversary:
      - "0425#AA农历生日#"
      - “0621#BB农历生日#”
    calculate_age:
      - date: '2026-11-24 10:23:10'
      name: "AA和CC结婚二十周年"   

crazysiri 发表于 2020-2-6 11:06:40

xiaoguaileo 发表于 2020-2-6 10:29
插件安装路径,/配置文件主目录/custom_components/chineseholiday/ 文件都放在这里

yaml配置


“0621#BB农历生日#” 改成 "0621#BB农历生日#" 注意一下这个双引号。。。

crazysiri 发表于 2020-2-6 11:13:42

xiaoguaileo 发表于 2020-2-6 10:29
插件安装路径,/配置文件主目录/custom_components/chineseholiday/ 文件都放在这里

yaml配置


配置文件里的标点 如果 不是特别熟悉 就全部都用半角,不要用全角。例如:半角:''   ""全角: ‘’   “”

Roger 发表于 2020-2-6 17:35:20

Github已经star了

crazysiri 发表于 2020-2-6 20:18:25

Roger 发表于 2020-2-6 17:35
Github已经star了

主要你得用好了哈哈哈

a120578270 发表于 2020-2-8 04:39:17

请问多久更新一次时间?0点的时候没更新等到4点还没更新

crazysiri 发表于 2020-2-8 17:56:18

a120578270 发表于 2020-2-8 04:39
请问多久更新一次时间?0点的时候没更新等到4点还没更新

目前这里可能有个问题,是30秒更新,但是你那没更新可能是组件崩溃了,我今天会更新一版,然后到时候这里回复,你到时候下载看看
页: 1 2 [3] 4 5 6 7 8 9 10 11 12
查看完整版本: 【20200330显示xx生日(1岁)】节假日 纪念日 农历 阴历 阳历插件