File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -113,27 +113,28 @@ async def _sense_report(self, response: PlugwiseResponse) -> bool:
113113 raise MessageError (
114114 f"Invalid response message type ({ response .__class__ .__name__ } ) received, expected SenseReportResponse"
115115 )
116- report_received_1 = report_received_2 = False
116+ report_received = False
117117 await self ._available_update_state (True , response .timestamp )
118118 if response .temperature .value != 65535 :
119119 self ._sense_statistics .temperature = float (
120120 SENSE_TEMPERATURE_MULTIPLIER * (response .temperature .value / 65536 )
121121 - SENSE_TEMPERATURE_OFFSET
122122 )
123- report_received_1 = True
123+ report_received = True
124124
125125 if response .humidity .value != 65535 :
126126 self ._sense_statistics .humidity = float (
127127 SENSE_HUMIDITY_MULTIPLIER * (response .humidity .value / 65536 )
128128 - SENSE_HUMIDITY_OFFSET
129129 )
130- report_received_2 = True
130+ report_received = True
131131
132- await self .publish_feature_update_to_subscribers (
133- NodeFeature .SENSE , self ._sense_statistics
134- )
132+ if report_received :
133+ await self .publish_feature_update_to_subscribers (
134+ NodeFeature .SENSE , self ._sense_statistics
135+ )
135136
136- return report_received_1 and report_received_2
137+ return report_received
137138
138139 @raise_not_loaded
139140 async def get_state (self , features : tuple [NodeFeature ]) -> dict [NodeFeature , Any ]:
You can’t perform that action at this time.
0 commit comments