Add tplink hardware version to device info (#65951)

* Add tplink hardware version to device info

* Update mocks

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Teemu R 2022-02-06 23:37:54 +01:00 committed by GitHub
parent c28821aeca
commit f4ebb03bab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -54,6 +54,7 @@ class CoordinatedTPLinkEntity(CoordinatorEntity):
model=self.device.model,
name=self.device.alias,
sw_version=self.device.hw_info["sw_ver"],
hw_version=self.device.hw_info["hw_ver"],
)
@property

View File

@ -38,7 +38,7 @@ def _mocked_bulb() -> SmartBulb:
bulb.device_id = MAC_ADDRESS
bulb.valid_temperature_range.min = 4000
bulb.valid_temperature_range.max = 9000
bulb.hw_info = {"sw_ver": "1.0.0"}
bulb.hw_info = {"sw_ver": "1.0.0", "hw_ver": "1.0.0"}
bulb.turn_off = AsyncMock()
bulb.turn_on = AsyncMock()
bulb.set_brightness = AsyncMock()
@ -65,7 +65,7 @@ def _mocked_dimmer() -> SmartDimmer:
dimmer.device_id = MAC_ADDRESS
dimmer.valid_temperature_range.min = 4000
dimmer.valid_temperature_range.max = 9000
dimmer.hw_info = {"sw_ver": "1.0.0"}
dimmer.hw_info = {"sw_ver": "1.0.0", "hw_ver": "1.0.0"}
dimmer.turn_off = AsyncMock()
dimmer.turn_on = AsyncMock()
dimmer.set_brightness = AsyncMock()
@ -88,7 +88,7 @@ def _mocked_plug() -> SmartPlug:
plug.is_strip = False
plug.is_plug = True
plug.device_id = MAC_ADDRESS
plug.hw_info = {"sw_ver": "1.0.0"}
plug.hw_info = {"sw_ver": "1.0.0", "hw_ver": "1.0.0"}
plug.turn_off = AsyncMock()
plug.turn_on = AsyncMock()
plug.set_led = AsyncMock()
@ -109,7 +109,7 @@ def _mocked_strip() -> SmartStrip:
strip.is_strip = True
strip.is_plug = True
strip.device_id = MAC_ADDRESS
strip.hw_info = {"sw_ver": "1.0.0"}
strip.hw_info = {"sw_ver": "1.0.0", "hw_ver": "1.0.0"}
strip.turn_off = AsyncMock()
strip.turn_on = AsyncMock()
strip.set_led = AsyncMock()