Convert august to be push instead of poll (#47544)

This commit is contained in:
J. Nick Koston 2021-03-21 19:35:12 -10:00 committed by GitHub
parent 8e4c0e3ff7
commit a2c4b438ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 683 additions and 183 deletions

View file

@ -1,7 +1,7 @@
"""Support for August sensors."""
import logging
from august.activity import ActivityType
from yalexs.activity import ActivityType
from homeassistant.components.sensor import DEVICE_CLASS_BATTERY
from homeassistant.const import ATTR_ENTITY_PICTURE, PERCENTAGE, STATE_UNAVAILABLE
@ -154,7 +154,7 @@ class AugustOperatorSensor(AugustEntityMixin, RestoreEntity, Entity):
def _update_from_data(self):
"""Get the latest state of the sensor and update activity."""
lock_activity = self._data.activity_stream.get_latest_device_activity(
self._device_id, [ActivityType.LOCK_OPERATION]
self._device_id, {ActivityType.LOCK_OPERATION}
)
self._available = True