1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix bug and bump geniushub client (#25599)

Fix bug, delint and bump client
This commit is contained in:
David Bonnes
2019-07-31 18:44:09 +01:00
committed by GitHub
parent 8ffc6c05b7
commit 16a98359c3
5 changed files with 13 additions and 11 deletions

View File

@@ -1,10 +1,10 @@
"""Support for Genius Hub binary_sensor devices."""
from datetime import datetime
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.util.dt import utc_from_timestamp
from . import DOMAIN
@@ -67,9 +67,8 @@ class GeniusBinarySensor(BinarySensorDevice):
attrs = {}
attrs['assigned_zone'] = self._device.assignedZones[0]['name']
last_comms = self._device._info_raw['childValues']['lastComms']['val'] # noqa; pylint: disable=protected-access
last_comms = self._device._raw_json['childValues']['lastComms']['val'] # noqa; pylint: disable=protected-access
if last_comms != 0:
attrs['last_comms'] = datetime.utcfromtimestamp(
last_comms).isoformat()
attrs['last_comms'] = utc_from_timestamp(last_comms).isoformat()
return {**attrs}