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

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

[插件集成] 2018年【修复bug】【节假日】【纪念日】【倒计时】【农历】

  [复制链接]

42

主题

522

帖子

2945

积分

金牌会员

Rank: 6Rank: 6

积分
2945
金钱
2423
HASS币
10
发表于 2018-5-5 13:52:02 | 显示全部楼层
万年历吗         
回复

使用道具 举报

7

主题

123

帖子

806

积分

高级会员

Rank: 4

积分
806
金钱
683
HASS币
0
发表于 2018-5-5 20:09:30 | 显示全部楼层
看看,好用不 ,学学 谢谢
回复

使用道具 举报

9

主题

216

帖子

2224

积分

金牌会员

Rank: 6Rank: 6

积分
2224
金钱
2008
HASS币
20
发表于 2018-5-5 20:29:42 | 显示全部楼层
学习下
回复

使用道具 举报

65

主题

853

帖子

3044

积分

论坛元老

Rank: 8Rank: 8

积分
3044
金钱
2184
HASS币
40
发表于 2018-5-5 23:47:37 | 显示全部楼层
出错了哈。。。。。
Log Details (ERROR)
Sat May 05 2018 23:33:07 GMT+0800 (中国标准时间)

chineseholiday: Error on device update!
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3.6/site-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0xb3214f30>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.goseek.cn', port=443): Max retries exceeded with url: /Tools/holiday?date=20180505 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb3214f30>: Failed to establish a new connection: [Errno -3] Try again',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 244, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 319, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/sensor/chineseholiday.py", line 203, in _update
    self._state = self.is_holiday_today()
  File "/config/custom_components/sensor/chineseholiday.py", line 175, in is_holiday_today
    return self.is_holiday(today)
  File "/config/custom_components/sensor/chineseholiday.py", line 153, in is_holiday
    rep =requests.get(holiday_api)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.goseek.cn', port=443): Max retries exceeded with url: /Tools/holiday?date=20180505 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb3214f30>: Failed to establish a new connection: [Errno -3] Try again',))
回复

使用道具 举报

26

主题

553

帖子

2728

积分

金牌会员

Rank: 6Rank: 6

积分
2728
金钱
2150
HASS币
100

教程狂人

发表于 2018-5-6 00:17:08 | 显示全部楼层
自己编了一个农历和节假日的小插件,这才刚发现原来L大早就写了,白折腾啊
回复

使用道具 举报

0

主题

28

帖子

105

积分

注册会员

Rank: 2

积分
105
金钱
77
HASS币
0
发表于 2018-5-6 20:59:28 | 显示全部楼层
看看看看看看看看看看看看
回复

使用道具 举报

12

主题

335

帖子

2348

积分

论坛DIY达人

积分
2348
金钱
2008
HASS币
0
发表于 2018-5-9 12:36:20 | 显示全部楼层
不好意思,请问这个插件是不是罢工了
回复

使用道具 举报

0

主题

41

帖子

139

积分

注册会员

Rank: 2

积分
139
金钱
98
HASS币
0
发表于 2018-5-30 18:06:28 | 显示全部楼层
正需要
回复

使用道具 举报

2

主题

96

帖子

665

积分

高级会员

Rank: 4

积分
665
金钱
569
HASS币
0
发表于 2018-5-31 03:50:34 | 显示全部楼层
这个很不错,值得使用
回复

使用道具 举报

11

主题

271

帖子

3099

积分

论坛元老

Rank: 8Rank: 8

积分
3099
金钱
2828
HASS币
10
发表于 2018-6-12 15:50:47 | 显示全部楼层
回去试试能不能加到自动化里
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-23 00:06 , Processed in 0.877289 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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