Skip to content

Commit

Permalink
Fix netatmo with python 3.11 (#88093)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Feb 15, 2023
1 parent b21bf87 commit 6f38bc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions homeassistant/components/netatmo/netatmo_entity_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ def async_update_callback(self) -> None:
@property
def device_info(self) -> DeviceInfo:
"""Return the device info for the sensor."""
manufacturer, model = DEVICE_DESCRIPTION_MAP[
getattr(NetatmoDeviceType, self._model)
]
if "." in self._model:
netatmo_device = NetatmoDeviceType(self._model.partition(".")[2])
else:
netatmo_device = getattr(NetatmoDeviceType, self._model)
manufacturer, model = DEVICE_DESCRIPTION_MAP[netatmo_device]
return DeviceInfo(
configuration_url=self._config_url,
identifiers={(DOMAIN, self._id)},
Expand Down
2 changes: 1 addition & 1 deletion tests/components/netatmo/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ async def test_service_set_camera_light_invalid_type(
await hass.async_block_till_done()

mock_set_state.assert_not_called()
assert excinfo.value.args == ("NACamera <Hall> does not have a floodlight",)
assert "NACamera <Hall> does not have a floodlight" in excinfo.value.args[0]


async def test_camera_reconnect_webhook(hass: HomeAssistant, config_entry) -> None:
Expand Down

0 comments on commit 6f38bc2

Please sign in to comment.