Fix entities device_info property in Harmony integration (#45964)

This commit is contained in:
Maciej Bieniek 2021-02-04 14:16:09 +01:00 committed by GitHub
parent 1a74709757
commit 134b1d3f63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -161,7 +161,7 @@ class HarmonyRemote(ConnectionStateMixin, remote.RemoteEntity, RestoreEntity):
@property
def device_info(self):
"""Return device info."""
self._data.device_info(DOMAIN)
return self._data.device_info(DOMAIN)
@property
def unique_id(self):

View File

@ -46,6 +46,11 @@ class HarmonyActivitySwitch(ConnectionStateMixin, SwitchEntity):
"""Return the unique id."""
return f"{self._data.unique_id}-{self._activity}"
@property
def device_info(self):
"""Return device info."""
return self._data.device_info(DOMAIN)
@property
def is_on(self):
"""Return if the current activity is the one for this switch."""

View File

@ -49,6 +49,7 @@ class FakeHarmonyClient:
self.change_channel = AsyncMock()
self.sync = AsyncMock()
self._callbacks = callbacks
self.fw_version = "123.456"
async def connect(self):
"""Connect and call the appropriate callbacks."""

View File

@ -153,7 +153,7 @@ async def test_form_cannot_connect(hass):
assert result2["errors"] == {"base": "cannot_connect"}
async def test_options_flow(hass, mock_hc):
async def test_options_flow(hass, mock_hc, mock_write_config):
"""Test config flow options."""
config_entry = MockConfigEntry(
domain=DOMAIN,