From 4a4ff083c55ee5476859d8b633600afad81a116b Mon Sep 17 00:00:00 2001 From: rgc99 Date: Mon, 17 Jan 2022 20:37:48 +0000 Subject: [PATCH] Fix #49 Invalid config after updating to 2022.1.0 --- custom_components/irrigation_unlimited/entity.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/custom_components/irrigation_unlimited/entity.py b/custom_components/irrigation_unlimited/entity.py index 5576fb4..fd85aec 100644 --- a/custom_components/irrigation_unlimited/entity.py +++ b/custom_components/irrigation_unlimited/entity.py @@ -108,7 +108,7 @@ async def async_added_to_hass(self): ) self._coordinator.service_call(service, controller, zone, {}) - data = IUAdjustment(zne[ATTR_ADJUSTMENT]).to_dict() + data = IUAdjustment(zne.get(ATTR_ADJUSTMENT)).to_dict() if data != {}: self._coordinator.service_call( SERVICE_TIME_ADJUST, controller, zone, data @@ -127,7 +127,7 @@ async def async_added_to_hass(self): {CONF_SEQUENCE_ID: sequence[CONF_INDEX] + 1}, ) - data = IUAdjustment(sequence[ATTR_ADJUSTMENT]).to_dict() + data = IUAdjustment(sequence.get(ATTR_ADJUSTMENT)).to_dict() if data != {}: data[CONF_SEQUENCE_ID] = sequence[CONF_INDEX] + 1 self._coordinator.service_call( @@ -150,7 +150,9 @@ async def async_added_to_hass(self): }, ) - data = IUAdjustment(sequence_zone[ATTR_ADJUSTMENT]).to_dict() + data = IUAdjustment( + sequence_zone.get(ATTR_ADJUSTMENT) + ).to_dict() if data != {}: data[CONF_SEQUENCE_ID] = sequence[CONF_INDEX] + 1 data[CONF_ZONES] = [sequence_zone[CONF_INDEX] + 1]