mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Polling is default (#23622)
This commit is contained in:
parent
a6b898d702
commit
5267635d2c
@ -3,15 +3,15 @@ import logging
|
|||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.const import CONF_NAME
|
|
||||||
from homeassistant.helpers.entity import Entity
|
|
||||||
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 CONF_NAME
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
from homeassistant.helpers.entity import Entity
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
CONF_SERIAL_DEVICE = 'serial_device'
|
|
||||||
CONF_BRAND = 'brand'
|
CONF_BRAND = 'brand'
|
||||||
|
CONF_SERIAL_DEVICE = 'serial_device'
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
vol.Required(CONF_BRAND): cv.string,
|
vol.Required(CONF_BRAND): cv.string,
|
||||||
@ -82,7 +82,3 @@ class ParticulateMatterSensor(Entity):
|
|||||||
self._state = self._collector.read_data()[self._pmname]
|
self._state = self._collector.read_data()[self._pmname]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
_LOGGER.error("Could not read PM%s value", self._pmname)
|
_LOGGER.error("Could not read PM%s value", self._pmname)
|
||||||
|
|
||||||
def should_poll(self):
|
|
||||||
"""Sensor needs polling."""
|
|
||||||
return True
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user