微信扫码登录
3
133
1381
金牌会员
使用道具 举报
81
1444
3万
元老级技术达人
scabbers 发表于 2023-1-17 17:06 大佬,这个怎么操作
@property def available(self): """Return True if entity is available.""" #return self.coordinator.last_update_success return (int(datetime.now().timestamp()) - int(self.coordinator.data["server_time"]) < 1800)
可用性的判断由更新成功改成:30分钟以内请求不到数据保持可用,30分钟后还没有新数据则变为不可用。
本版积分规则 发表回复
Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )
GMT+8, 2025-9-15 04:58 , Processed in 0.307166 second(s), 7 queries , MemCached On.
Powered by Discuz! X3.5
© 2001-2025 Discuz! Team.