Skip to content

Commit

Permalink
Fix #49 Invalid config after updating to 2022.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rgc99 committed Jan 17, 2022
1 parent 07245e5 commit 4a4ff08
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions custom_components/irrigation_unlimited/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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]
Expand Down

0 comments on commit 4a4ff08

Please sign in to comment.