소스 검색

Always fire callbacks when we do a full update since all sensors will update (#162)

J. Nick Koston 2 년 전
부모
커밋
1d56820a14
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      switchbot/devices/device.py

+ 1 - 1
switchbot/devices/device.py

@@ -96,7 +96,6 @@ def update_after_operation(func: WrapFuncType) -> WrapFuncType:
     ) -> None:
         ret = await func(self, *args, **kwargs)
         await self.update()
-        self._fire_callbacks()
         return ret
 
     return cast(WrapFuncType, _async_update_after_operation_wrap)
@@ -520,6 +519,7 @@ class SwitchbotBaseDevice:
         if info := await self.get_basic_info():
             self._last_full_update = time.monotonic()
             self._update_parsed_data(info)
+            self._fire_callbacks()
 
     async def get_basic_info(self) -> dict[str, Any] | None:
         """Get device basic settings."""