Skip to content

Commit

Permalink
0.0.6 Fixes a bug causing error messages in log
Browse files Browse the repository at this point in the history
  • Loading branch information
gadget-man committed Jul 16, 2021
1 parent ea3ec48 commit cc0d26f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async def async_will_remove_from_hass(self) -> None:
@callback
def _update_callback(self, data):
"""Call update method."""
if (data[self._sensor]!= ''):
if self._sensor in data:
_LOGGER.debug("Binary Sensor: %s - %s", self._sensor, data[self._sensor])
self._state = data[self._sensor]
self.async_schedule_update_ha_state(True)
Expand Down
12 changes: 6 additions & 6 deletions sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ async def async_will_remove_from_hass(self) -> None:

@callback
def _update_callback(self, data):
if (data[self._sensor]!= ''):
if self._sensor in data:
"""Call update method."""
_LOGGER.debug("iParcelBox Sensor callback: %s", data[self._sensor])
self._state = data[self._sensor]
self.async_schedule_update_ha_state(True)

@callback
def _update_message_callback(self, data):
# if (data[self._sensor]!= ''):
"""Call update method."""
_LOGGER.debug("iParcelBox Message callback: %s", data[self._sensor])
self._state = data[self._sensor]
self.async_schedule_update_ha_state(True)
if self._sensor in data:
"""Call update method."""
_LOGGER.debug("iParcelBox Message callback: %s", data[self._sensor])
self._state = data[self._sensor]
self.async_schedule_update_ha_state(True)


# @asyncio.coroutine
Expand Down

0 comments on commit cc0d26f

Please sign in to comment.