Insteon bug fixes (#73791)

pull/73821/head
Tom Harris 2022-06-22 04:04:11 -04:00 committed by Franck Nijhof
parent 5c71de8055
commit 29f8493a06
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
6 changed files with 14 additions and 16 deletions

View File

@ -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"

View File

@ -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": [

View File

@ -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."""

View File

@ -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

View File

@ -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

View File

@ -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"}