『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
楼主: crazysiri

[插件集成] 【20200330显示xx生日(1岁)】节假日 纪念日 农历 阴历 阳历插件

  [复制链接]

6

主题

15

帖子

359

积分

论坛分享达人

积分
359
金钱
344
HASS币
10
发表于 2020-7-5 13:32:29 | 显示全部楼层
提示我汉化这是为什么
1593926399(1).jpg
回复

使用道具 举报

15

主题

297

帖子

1501

积分

论坛技术达人

积分
1501
金钱
1199
HASS币
30
 楼主| 发表于 2020-7-5 14:35:04 | 显示全部楼层
banzhanglaolin 发表于 2020-7-5 13:32
提示我汉化这是为什么

提示你汉化?你发这个图的意思就是启动的时候会请求接口会卡主线程,可能会卡那么几秒,就是占了io而已,没有大的影响
回复

使用道具 举报

2

主题

175

帖子

1989

积分

金牌会员

Rank: 6Rank: 6

积分
1989
金钱
1814
HASS币
0
发表于 2021-1-2 15:11:33 | 显示全部楼层
现在新版本里好像不能显示了,
回复

使用道具 举报

1

主题

23

帖子

378

积分

中级会员

Rank: 3Rank: 3

积分
378
金钱
355
HASS币
0
发表于 2021-1-2 16:49:23 | 显示全部楼层
大神作者,你的日历2021年千年虫病毒发了,你的实体失效了,求赶快更新吧
回复

使用道具 举报

15

主题

438

帖子

4156

积分

论坛元老

Rank: 8Rank: 8

积分
4156
金钱
3718
HASS币
0
发表于 2021-1-2 17:43:06 | 显示全部楼层
插件失效了
回复

使用道具 举报

23

主题

338

帖子

4322

积分

元老级技术达人

积分
4322
金钱
3959
HASS币
120
发表于 2021-1-4 10:17:32 | 显示全部楼层
本帖最后由 121665460 于 2021-1-4 11:03 编辑
Logger: homeassistant.components.sensor
Source: custom_components/chineseholiday/holiday.py:406
Integration: 传感器 (documentation, issues)
First occurred: 上午10:14:59 (1 occurrences)
Last logged: 上午10:14:59

chineseholiday: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    await task
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 239, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/chineseholiday/sensor.py", line 492, in _update
    nearest = self.nearest_holiday()
  File "/config/custom_components/chineseholiday/sensor.py", line 430, in nearest_holiday
    results = self._holiday.getHoliday()
  File "/config/custom_components/chineseholiday/holiday.py", line 354, in getHoliday
    list = self.getholidayForNMonths()
  File "/config/custom_components/chineseholiday/holiday.py", line 390, in getholidayForNMonths
    results = self.getonline40dholiday('101010100',str(year),"{:0>2d}".format(m))
  File "/config/custom_components/chineseholiday/holiday.py", line 406, in getonline40dholiday
    list = json.loads(json_str)
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/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)


报错了。看代码是json解析失败了
回复

使用道具 举报

23

主题

338

帖子

4322

积分

元老级技术达人

积分
4322
金钱
3959
HASS币
120
发表于 2021-1-4 14:48:20 | 显示全部楼层
本帖最后由 121665460 于 2021-1-4 14:54 编辑
121665460 发表于 2021-1-4 10:17
报错了。看代码是json解析失败了

http://d1.weather.com.cn/calendar_new/2021/101010100_202100.html
发现日期错了,
385行改要成m = month + 1
github改好上提pull request了


回复

使用道具 举报

15

主题

297

帖子

1501

积分

论坛技术达人

积分
1501
金钱
1199
HASS币
30
 楼主| 发表于 2021-1-4 18:53:58 | 显示全部楼层
嗯哼,代码里有个bug,现在已经修复了,大家可以下载一下最新的代码,在那个git里 :https://github.com/Crazysiri/chineseholiday
回复

使用道具 举报

15

主题

297

帖子

1501

积分

论坛技术达人

积分
1501
金钱
1199
HASS币
30
 楼主| 发表于 2021-1-4 18:57:23 | 显示全部楼层
121665460 发表于 2021-1-4 14:48
http://d1.weather.com.cn/calendar_new/2021/101010100_202100.html
发现日期错了,
385行改要成m = mont ...

你的思路是对的,但是会引起别的问题,我改完了
回复

使用道具 举报

7

主题

144

帖子

1018

积分

金牌会员

Rank: 6Rank: 6

积分
1018
金钱
874
HASS币
0
发表于 2021-1-10 17:43:26 | 显示全部楼层
本帖最后由 toher 于 2021-1-10 17:45 编辑

请教!我更新了这两个文件,问什么还是显示出错?日志详细信息( ERROR )
[color=var(--mdc-dialog-content-ink-color, rgba(0, 0, 0, 0.6))]Logger: frontend.js.latest.202012291
Source: components/system_log/__init__.py:193
First occurred: 下午5:36:27 (4 occurrences)
Last logged: 下午5:36:27
  • http://192.168.1.xxx:xxx/local/custom-lovelace/ch_calendar-card/ch_calendar-card.js:225:42 Uncaught TypeError: Cannot read property 'attributes' of null
  • http://192.168.1.xxx:xxx/lovelace/0:0:0 Uncaught
  • http://192.168.1.xxx:xxx/local/community/lovelace-cn-map/cn-map-card.js:6:1 Uncaught SyntaxError: Unexpected token '<'



截屏2021-01-10 下午5.39.49.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-20 16:08 , Processed in 1.485169 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表