@@ -143,48 +143,42 @@ async def async_test_metering(
143
143
assert entity .state ["status" ] == "NO_ALARMS"
144
144
assert entity .state ["device_type" ] == "Electric Metering"
145
145
146
- # these tests change the device type of the device... this is not possible in the real world
147
- # there is no way to currently send info_object changes to the client side so this is not
148
- # possible to test for now
149
- if not isinstance (entity , sensor .WebSocketClientSensorEntity ):
150
- await send_attributes_report (
151
- zha_gateway , cluster , {1024 : 12346 , "status" : 64 + 8 }
152
- )
153
- assert_state (entity , 12346.0 , None )
154
- assert entity .state ["status" ] in (
155
- "SERVICE_DISCONNECT|POWER_FAILURE" ,
156
- "POWER_FAILURE|SERVICE_DISCONNECT" ,
157
- )
146
+ await send_attributes_report (zha_gateway , cluster , {1024 : 12346 , "status" : 64 + 8 })
147
+ assert_state (entity , 12346.0 , None )
148
+ assert entity .state ["status" ] in (
149
+ "SERVICE_DISCONNECT|POWER_FAILURE" ,
150
+ "POWER_FAILURE|SERVICE_DISCONNECT" ,
151
+ )
158
152
159
- await send_attributes_report (
160
- zha_gateway , cluster , {"status" : 64 + 8 , "metering_device_type" : 1 }
161
- )
162
- assert entity .state ["status" ] in (
163
- "SERVICE_DISCONNECT|NOT_DEFINED" ,
164
- "NOT_DEFINED|SERVICE_DISCONNECT" ,
165
- )
153
+ await send_attributes_report (
154
+ zha_gateway , cluster , {"status" : 64 + 8 , "metering_device_type" : 1 }
155
+ )
156
+ assert entity .state ["status" ] in (
157
+ "SERVICE_DISCONNECT|NOT_DEFINED" ,
158
+ "NOT_DEFINED|SERVICE_DISCONNECT" ,
159
+ )
166
160
167
- await send_attributes_report (
168
- zha_gateway , cluster , {"status" : 64 + 8 , "metering_device_type" : 2 }
169
- )
170
- assert entity .state ["status" ] in (
171
- "SERVICE_DISCONNECT|PIPE_EMPTY" ,
172
- "PIPE_EMPTY|SERVICE_DISCONNECT" ,
173
- )
161
+ await send_attributes_report (
162
+ zha_gateway , cluster , {"status" : 64 + 8 , "metering_device_type" : 2 }
163
+ )
164
+ assert entity .state ["status" ] in (
165
+ "SERVICE_DISCONNECT|PIPE_EMPTY" ,
166
+ "PIPE_EMPTY|SERVICE_DISCONNECT" ,
167
+ )
174
168
175
- await send_attributes_report (
176
- zha_gateway , cluster , {"status" : 64 + 8 , "metering_device_type" : 5 }
177
- )
178
- assert entity .state ["status" ] in (
179
- "SERVICE_DISCONNECT|TEMPERATURE_SENSOR" ,
180
- "TEMPERATURE_SENSOR|SERVICE_DISCONNECT" ,
181
- )
169
+ await send_attributes_report (
170
+ zha_gateway , cluster , {"status" : 64 + 8 , "metering_device_type" : 5 }
171
+ )
172
+ assert entity .state ["status" ] in (
173
+ "SERVICE_DISCONNECT|TEMPERATURE_SENSOR" ,
174
+ "TEMPERATURE_SENSOR|SERVICE_DISCONNECT" ,
175
+ )
182
176
183
- # Status for other meter types
184
- await send_attributes_report (
185
- zha_gateway , cluster , {"status" : 32 , "metering_device_type" : 4 }
186
- )
187
- assert entity .state ["status" ] in ("<bitmap8.32: 32>" , "32" )
177
+ # Status for other meter types
178
+ await send_attributes_report (
179
+ zha_gateway , cluster , {"status" : 32 , "metering_device_type" : 4 }
180
+ )
181
+ assert entity .state ["status" ] in ("<bitmap8.32: 32>" , "32" )
188
182
189
183
190
184
async def async_test_smart_energy_summation_delivered (
0 commit comments