Add binary_sensor
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
"""Sensor platform for blueprint"""
|
||||
"""Sensor platform for blueprint."""
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from . import update_data
|
||||
from .const import DOMAIN as NAME, DOMAIN_DATA, SENSOR_ICON
|
||||
@ -27,12 +27,11 @@ class BlueprintSensor(Entity):
|
||||
# Get new data (if any)
|
||||
updated = self.hass.data[DOMAIN_DATA]
|
||||
|
||||
# Check if there is data
|
||||
# Check the data and update the value.
|
||||
if updated.get("title") is None:
|
||||
updated = self._state
|
||||
|
||||
# Set/update the state, and make sure it looks good by capitalizing it
|
||||
self._state = updated.capitalize()
|
||||
self._state = self._status
|
||||
else:
|
||||
self._state = updated.get("title")
|
||||
|
||||
# Set/update attributes
|
||||
self.attr['user_id'] = updated.get('userId')
|
||||
|
Reference in New Issue
Block a user