diff --git a/homeassistant/components/insteon/api/properties.py b/homeassistant/components/insteon/api/properties.py index 47def71c1ab..8e697a88459 100644 --- a/homeassistant/components/insteon/api/properties.py +++ b/homeassistant/components/insteon/api/properties.py @@ -99,8 +99,6 @@ def get_properties(device: Device, show_advanced=False): continue prop_schema = get_schema(prop, name, device.groups) - if name == "momentary_delay": - print(prop_schema) if prop_schema is None: continue schema[name] = prop_schema @@ -216,7 +214,7 @@ async def websocket_write_properties( result = await device.async_write_config() await devices.async_save(workdir=hass.config.config_dir) - if result != ResponseStatus.SUCCESS: + if result not in [ResponseStatus.SUCCESS, ResponseStatus.RUN_ON_WAKE]: connection.send_message( websocket_api.error_message( msg[ID], "write_failed", "properties not written to device" @@ -244,9 +242,10 @@ async def websocket_load_properties( notify_device_not_found(connection, msg, INSTEON_DEVICE_NOT_FOUND) return - result, _ = await device.async_read_config(read_aldb=False) + result = await device.async_read_config(read_aldb=False) await devices.async_save(workdir=hass.config.config_dir) - if result != ResponseStatus.SUCCESS: + + if result not in [ResponseStatus.SUCCESS, ResponseStatus.RUN_ON_WAKE]: connection.send_message( websocket_api.error_message( msg[ID], "load_failed", "properties not loaded from device" diff --git a/homeassistant/components/insteon/manifest.json b/homeassistant/components/insteon/manifest.json index c69f4f2cdf5..1be077a6b38 100644 --- a/homeassistant/components/insteon/manifest.json +++ b/homeassistant/components/insteon/manifest.json @@ -4,8 +4,8 @@ "documentation": "https://www.home-assistant.io/integrations/insteon", "dependencies": ["http", "websocket_api"], "requirements": [ - "pyinsteon==1.1.0", - "insteon-frontend-home-assistant==0.1.0" + "pyinsteon==1.1.1", + "insteon-frontend-home-assistant==0.1.1" ], "codeowners": ["@teharris1"], "dhcp": [ diff --git a/homeassistant/components/insteon/utils.py b/homeassistant/components/insteon/utils.py index e8e34ee8e62..09375e7827a 100644 --- a/homeassistant/components/insteon/utils.py +++ b/homeassistant/components/insteon/utils.py @@ -196,9 +196,8 @@ def async_register_services(hass): for address in devices: device = devices[address] if device != devices.modem and device.cat != 0x03: - await device.aldb.async_load( - refresh=reload, callback=async_srv_save_devices - ) + await device.aldb.async_load(refresh=reload) + await async_srv_save_devices() async def async_srv_save_devices(): """Write the Insteon device configuration to file.""" diff --git a/requirements_all.txt b/requirements_all.txt index c42bbe6c076..b52f43924d9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -885,7 +885,7 @@ influxdb-client==1.24.0 influxdb==5.3.1 # homeassistant.components.insteon -insteon-frontend-home-assistant==0.1.0 +insteon-frontend-home-assistant==0.1.1 # homeassistant.components.intellifire intellifire4py==1.0.2 @@ -1556,7 +1556,7 @@ pyialarmxr-homeassistant==1.0.18 pyicloud==1.0.0 # homeassistant.components.insteon -pyinsteon==1.1.0 +pyinsteon==1.1.1 # homeassistant.components.intesishome pyintesishome==1.7.6 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index a1efb0f1941..1f70484f554 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -628,7 +628,7 @@ influxdb-client==1.24.0 influxdb==5.3.1 # homeassistant.components.insteon -insteon-frontend-home-assistant==0.1.0 +insteon-frontend-home-assistant==0.1.1 # homeassistant.components.intellifire intellifire4py==1.0.2 @@ -1044,7 +1044,7 @@ pyialarmxr-homeassistant==1.0.18 pyicloud==1.0.0 # homeassistant.components.insteon -pyinsteon==1.1.0 +pyinsteon==1.1.1 # homeassistant.components.ipma pyipma==2.0.5 diff --git a/tests/components/insteon/test_api_properties.py b/tests/components/insteon/test_api_properties.py index 7211402e343..9088b23f42a 100644 --- a/tests/components/insteon/test_api_properties.py +++ b/tests/components/insteon/test_api_properties.py @@ -401,7 +401,7 @@ async def test_load_properties(hass, hass_ws_client, kpl_properties_data): ) device = devices["33.33.33"] - device.async_read_config = AsyncMock(return_value=(1, 1)) + device.async_read_config = AsyncMock(return_value=1) with patch.object(insteon.api.properties, "devices", devices): await ws_client.send_json( {ID: 2, TYPE: "insteon/properties/load", DEVICE_ADDRESS: "33.33.33"} @@ -418,7 +418,7 @@ async def test_load_properties_failure(hass, hass_ws_client, kpl_properties_data ) device = devices["33.33.33"] - device.async_read_config = AsyncMock(return_value=(0, 0)) + device.async_read_config = AsyncMock(return_value=0) with patch.object(insteon.api.properties, "devices", devices): await ws_client.send_json( {ID: 2, TYPE: "insteon/properties/load", DEVICE_ADDRESS: "33.33.33"}