mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Remove STATE_UNKNOWN (#10064)
This commit is contained in:
parent
f4f36a3662
commit
76a0763cbc
@ -13,8 +13,7 @@ import voluptuous as vol
|
|||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST, CONF_PORT, STATE_UNKNOWN, CONF_NAME, CONF_RESOURCES,
|
CONF_HOST, CONF_PORT, CONF_NAME, CONF_RESOURCES, TEMP_CELSIUS)
|
||||||
TEMP_CELSIUS)
|
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
@ -81,7 +80,7 @@ class GlancesSensor(Entity):
|
|||||||
self.rest = rest
|
self.rest = rest
|
||||||
self._name = name
|
self._name = name
|
||||||
self.type = sensor_type
|
self.type = sensor_type
|
||||||
self._state = STATE_UNKNOWN
|
self._state = None
|
||||||
self._unit_of_measurement = SENSOR_TYPES[sensor_type][1]
|
self._unit_of_measurement = SENSOR_TYPES[sensor_type][1]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -164,7 +163,7 @@ class GlancesData(object):
|
|||||||
def __init__(self, resource):
|
def __init__(self, resource):
|
||||||
"""Initialize the data object."""
|
"""Initialize the data object."""
|
||||||
self._resource = resource
|
self._resource = resource
|
||||||
self.data = dict()
|
self.data = {}
|
||||||
|
|
||||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||||
def update(self):
|
def update(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user