Action commit
This commit is contained in:
@ -3,17 +3,19 @@ from homeassistant.helpers.entity import Entity
|
||||
from . import update_data
|
||||
from .const import * # pylint: disable=wildcard-import, unused-wildcard-import
|
||||
|
||||
ICON = 'mdi:format-quote-close'
|
||||
ICON = "mdi:format-quote-close"
|
||||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass, config, async_add_entities, discovery_info=None): # pylint: disable=unused-argument
|
||||
hass, config, async_add_entities, discovery_info=None
|
||||
): # pylint: disable=unused-argument
|
||||
"""Setup sensor platform."""
|
||||
async_add_entities([blueprintSensor(hass)], True)
|
||||
|
||||
|
||||
class blueprintSensor(Entity):
|
||||
"""blueprint Sensor class."""
|
||||
|
||||
def __init__(self, hass):
|
||||
self.hass = hass
|
||||
self._state = None
|
||||
@ -21,7 +23,7 @@ class blueprintSensor(Entity):
|
||||
async def async_update(self):
|
||||
"""Update the sensor."""
|
||||
await update_data(self.hass)
|
||||
updated = self.hass.data[DOMAIN_DATA].get('compliment')
|
||||
updated = self.hass.data[DOMAIN_DATA].get("compliment")
|
||||
if updated is None:
|
||||
updated = self._state
|
||||
self._state = updated.capitalize()
|
||||
|
Reference in New Issue
Block a user