@@ -52,9 +52,10 @@ async def load(self) -> bool:
5252 """Load and activate Sense node features."""
5353 if self ._loaded :
5454 return True
55+
5556 self ._node_info .is_battery_powered = True
5657 if self ._cache_enabled :
57- _LOGGER .debug ("Load Sense node %s from cache" , self ._node_info .mac )
58+ _LOGGER .debug ("Loading Sense node %s from cache" , self ._node_info .mac )
5859 if await self ._load_from_cache ():
5960 self ._loaded = True
6061 self ._setup_protocol (
@@ -64,7 +65,8 @@ async def load(self) -> bool:
6465 if await self .initialize ():
6566 await self ._loaded_callback (NodeEvent .LOADED , self .mac )
6667 return True
67- _LOGGER .debug ("Load of Sense node %s failed" , self ._node_info .mac )
68+
69+ _LOGGER .debug ("Loading of Sense node %s failed" , self ._node_info .mac )
6870 return False
6971
7072 @raise_not_loaded
@@ -94,6 +96,7 @@ async def _sense_report(self, response: PlugwiseResponse) -> bool:
9496 raise MessageError (
9597 f"Invalid response message type ({ response .__class__ .__name__ } ) received, expected SenseReportResponse"
9698 )
99+ report_received = False
97100 await self ._available_update_state (True , response .timestamp )
98101 if response .temperature .value != 65535 :
99102 self ._temperature = int (
@@ -103,6 +106,8 @@ async def _sense_report(self, response: PlugwiseResponse) -> bool:
103106 await self .publish_feature_update_to_subscribers (
104107 NodeFeature .TEMPERATURE , self ._temperature
105108 )
109+ report_received = True
110+
106111 if response .humidity .value != 65535 :
107112 self ._humidity = int (
108113 SENSE_HUMIDITY_MULTIPLIER * (response .humidity .value / 65536 )
@@ -111,8 +116,9 @@ async def _sense_report(self, response: PlugwiseResponse) -> bool:
111116 await self .publish_feature_update_to_subscribers (
112117 NodeFeature .HUMIDITY , self ._humidity
113118 )
114- return True
115- return False
119+ report_received = True
120+
121+ return report_received
116122
117123 @raise_not_loaded
118124 async def get_state (self , features : tuple [NodeFeature ]) -> dict [NodeFeature , Any ]:
0 commit comments