Add cleanup to Notion (#32887)

* Add cleanup to Notion

* Base update method
This commit is contained in:
Aaron Bach
2020-03-17 05:01:40 -06:00
committed by GitHub
parent 0c49c8578b
commit 1da35e2939
3 changed files with 17 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
"""Support for Notion sensors."""
import logging
from homeassistant.core import callback
from . import SENSOR_TEMPERATURE, SENSOR_TYPES, NotionEntity
from .const import DATA_CLIENT, DOMAIN
@@ -58,7 +60,8 @@ class NotionSensor(NotionEntity):
"""Return the unit of measurement."""
return self._unit
async def async_update(self):
@callback
def update_from_latest_data(self):
"""Fetch new state data for the sensor."""
task = self._notion.tasks[self._task_id]