Update components to use Entity instead of Device
This commit is contained in:
1 parent
d3f0210b1a
commit
a9324ba9d4
19 files changed
+38
-37
No files matched your search
@@ -1,5 +1,5 @@
|
||||
""" Support for Wink sensors. """
|
||||
from homeassistant.helpers.device import Device
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.const import TEMP_CELCIUS, ATTR_BATTERY_LEVEL
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
])
|
||||
|
||||
|
||||
class DemoSensor(Device):
|
||||
class DemoSensor(Entity):
|
||||
""" A Demo sensor. """
|
||||
|
||||
def __init__(self, name, state, unit_of_measurement, battery):
|
||||
|
||||
@@ -52,7 +52,7 @@ list of all available variables
|
||||
from homeassistant.util import Throttle
|
||||
from datetime import timedelta
|
||||
|
||||
from homeassistant.helpers.device import Device
|
||||
from homeassistant.helpers.entity import Entity
|
||||
# pylint: disable=no-name-in-module, import-error
|
||||
from homeassistant.external.nzbclients.sabnzbd import SabnzbdApi
|
||||
from homeassistant.external.nzbclients.sabnzbd import SabnzbdApiException
|
||||
@@ -109,7 +109,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
add_devices(dev)
|
||||
|
||||
|
||||
class SabnzbdSensor(Device):
|
||||
class SabnzbdSensor(Entity):
|
||||
""" A Sabnzbd sensor """
|
||||
|
||||
def __init__(self, sensor_type, sabnzb_client, client_name):
|
||||
|
||||
@@ -6,7 +6,7 @@ Shows system monitor values such as: disk, memory and processor use
|
||||
|
||||
"""
|
||||
|
||||
from homeassistant.helpers.device import Device
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.const import STATE_ON, STATE_OFF
|
||||
import psutil
|
||||
import logging
|
||||
@@ -42,7 +42,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
add_devices(dev)
|
||||
|
||||
|
||||
class SystemMonitorSensor(Device):
|
||||
class SystemMonitorSensor(Entity):
|
||||
""" A system monitor sensor """
|
||||
|
||||
def __init__(self, sensor_type, argument=''):
|
||||
|
||||
@@ -30,7 +30,7 @@ import tellcore.telldus as telldus
|
||||
import tellcore.constants as tellcore_constants
|
||||
|
||||
from homeassistant.const import TEMP_CELCIUS
|
||||
from homeassistant.helpers.device import Device
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.util as util
|
||||
|
||||
DatatypeDescription = namedtuple("DatatypeDescription", ['name', 'unit'])
|
||||
@@ -93,7 +93,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
add_devices(sensors)
|
||||
|
||||
|
||||
class TellstickSensor(Device):
|
||||
class TellstickSensor(Entity):
|
||||
""" Represents a Tellstick sensor. """
|
||||
|
||||
def __init__(self, name, sensor, datatype, sensor_info):
|
||||
|
||||
@@ -50,7 +50,7 @@ import logging
|
||||
import time
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
from homeassistant.helpers import Device
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.const import (
|
||||
ATTR_BATTERY_LEVEL, ATTR_TRIPPED, ATTR_ARMED, ATTR_LAST_TRIP_TIME)
|
||||
# pylint: disable=no-name-in-module, import-error
|
||||
@@ -99,7 +99,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
add_devices(get_devices(hass, config))
|
||||
|
||||
|
||||
class VeraSensor(Device):
|
||||
class VeraSensor(Entity):
|
||||
""" Represents a Vera Sensor """
|
||||
|
||||
def __init__(self, vera_device, extra_data=None):
|
||||
|
||||
@@ -4,7 +4,7 @@ import logging
|
||||
# pylint: disable=no-name-in-module, import-error
|
||||
import homeassistant.external.wink.pywink as pywink
|
||||
|
||||
from homeassistant.helpers.device import Device
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, STATE_OPEN, STATE_CLOSED
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
add_devices(WinkSensorDevice(sensor) for sensor in pywink.get_sensors())
|
||||
|
||||
|
||||
class WinkSensorDevice(Device):
|
||||
class WinkSensorDevice(Entity):
|
||||
""" represents a wink sensor within home assistant. """
|
||||
|
||||
def __init__(self, wink):
|
||||
|
||||
@@ -9,7 +9,7 @@ from openzwave.network import ZWaveNetwork
|
||||
from pydispatch import dispatcher
|
||||
|
||||
import homeassistant.components.zwave as zwave
|
||||
from homeassistant.helpers.device import Device
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.const import (
|
||||
ATTR_BATTERY_LEVEL, STATE_ON, STATE_OFF,
|
||||
TEMP_CELCIUS, TEMP_FAHRENHEIT, ATTR_LOCATION)
|
||||
@@ -33,7 +33,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
add_devices([ZWaveMultilevelSensor(value)])
|
||||
|
||||
|
||||
class ZWaveSensor(Device):
|
||||
class ZWaveSensor(Entity):
|
||||
""" Represents a Z-Wave sensor. """
|
||||
def __init__(self, sensor_value):
|
||||
self._value = sensor_value
|
||||
|
||||
Reference in new issue
Block a user