Rename BinarySensorDevice to BinarySensorEntity (#34462)

* Rename BinarySensorDevice to BinarySensorEntity

* Tweak

* Move deprecation warning to __new__, add test

* Move deprecation warning back to __init__

* Move deprecation warning to __init_subclass
This commit is contained in:
Erik Montnemery 2020-04-23 21:57:07 +02:00 committed by GitHub
parent 0b64f49e3a
commit b022e08db9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
147 changed files with 371 additions and 352 deletions

View File

@ -3,7 +3,7 @@ import abodepy.helpers.constants as CONST
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_WINDOW,
BinarySensorDevice,
BinarySensorEntity,
)
from . import AbodeDevice
@ -30,7 +30,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(entities)
class AbodeBinarySensor(AbodeDevice, BinarySensorDevice):
class AbodeBinarySensor(AbodeDevice, BinarySensorEntity):
"""A binary sensor implementation for Abode device."""
@property

View File

@ -6,7 +6,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
import homeassistant.helpers.config_validation as cv
@ -37,7 +37,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([ads_sensor])
class AdsBinarySensor(AdsEntity, BinarySensorDevice):
class AdsBinarySensor(AdsEntity, BinarySensorEntity):
"""Representation of ADS binary sensors."""
def __init__(self, ads_hub, name, ads_var, device_class):

View File

@ -1,7 +1,7 @@
"""Support for AlarmDecoder zone states- represented as binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import (
CONF_RELAY_ADDR,
@ -53,7 +53,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
return True
class AlarmDecoderBinarySensor(BinarySensorDevice):
class AlarmDecoderBinarySensor(BinarySensorEntity):
"""Representation of an AlarmDecoder binary sensor."""
def __init__(

View File

@ -1,7 +1,7 @@
"""Support for Ambient Weather Station binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import ATTR_NAME
from homeassistant.core import callback
@ -54,7 +54,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
async_add_entities(binary_sensor_list, True)
class AmbientWeatherBinarySensor(AmbientWeatherEntity, BinarySensorDevice):
class AmbientWeatherBinarySensor(AmbientWeatherEntity, BinarySensorEntity):
"""Define an Ambient binary sensor."""
@property

View File

@ -7,7 +7,7 @@ from amcrest import AmcrestError
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
DEVICE_CLASS_MOTION,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import CONF_BINARY_SENSORS, CONF_NAME
from homeassistant.core import callback
@ -63,7 +63,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
)
class AmcrestBinarySensor(BinarySensorDevice):
class AmcrestBinarySensor(BinarySensorEntity):
"""Binary sensor for Amcrest camera."""
def __init__(self, name, device, sensor_type):

View File

@ -1,5 +1,5 @@
"""Support for Android IP Webcam binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import CONF_HOST, CONF_NAME, DATA_IP_WEBCAM, KEY_MAP, AndroidIPCamEntity
@ -16,7 +16,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([IPWebcamBinarySensor(name, host, ipcam, "motion_active")], True)
class IPWebcamBinarySensor(AndroidIPCamEntity, BinarySensorDevice):
class IPWebcamBinarySensor(AndroidIPCamEntity, BinarySensorEntity):
"""Representation of an IP Webcam binary sensor."""
def __init__(self, name, host, ipcam, sensor):

View File

@ -1,7 +1,7 @@
"""Support for tracking the online status of a UPS."""
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
@ -20,7 +20,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([OnlineStatus(config, apcups_data)], True)
class OnlineStatus(BinarySensorDevice):
class OnlineStatus(BinarySensorEntity):
"""Representation of an UPS online status."""
def __init__(self, config, data):

View File

@ -8,7 +8,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import (
CONF_DEVICE_CLASS,
@ -67,7 +67,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)
class ArestBinarySensor(BinarySensorDevice):
class ArestBinarySensor(BinarySensorEntity):
"""Implement an aREST binary sensor for a pin."""
def __init__(self, arest, resource, name, device_class, pin):

View File

@ -11,7 +11,7 @@ from homeassistant.components.binary_sensor import (
DEVICE_CLASS_DOOR,
DEVICE_CLASS_MOTION,
DEVICE_CLASS_OCCUPANCY,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.core import callback
from homeassistant.helpers.event import async_track_point_in_utc_time
@ -108,7 +108,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(devices, True)
class AugustDoorBinarySensor(AugustEntityMixin, BinarySensorDevice):
class AugustDoorBinarySensor(AugustEntityMixin, BinarySensorEntity):
"""Representation of an August Door binary sensor."""
def __init__(self, data, sensor_type, device):
@ -155,7 +155,7 @@ class AugustDoorBinarySensor(AugustEntityMixin, BinarySensorDevice):
return f"{self._device_id}_open"
class AugustDoorbellBinarySensor(AugustEntityMixin, BinarySensorDevice):
class AugustDoorbellBinarySensor(AugustEntityMixin, BinarySensorEntity):
"""Representation of an August binary sensor."""
def __init__(self, data, sensor_type, device):

View File

@ -7,7 +7,7 @@ from aiohttp.hdrs import USER_AGENT
import requests
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle
@ -54,7 +54,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([AuroraSensor(aurora_data, name)], True)
class AuroraSensor(BinarySensorDevice):
class AuroraSensor(BinarySensorEntity):
"""Implementation of an aurora sensor."""
def __init__(self, aurora_data, name):

View File

@ -4,7 +4,7 @@ from datetime import timedelta
from axis.event_stream import CLASS_INPUT, CLASS_OUTPUT
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_TRIGGER_TIME
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -32,7 +32,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
)
class AxisBinarySensor(AxisEventBase, BinarySensorDevice):
class AxisBinarySensor(AxisEventBase, BinarySensorEntity):
"""Representation of a binary Axis event."""
def __init__(self, event, device):

View File

@ -3,7 +3,7 @@ from collections import OrderedDict
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
CONF_ABOVE,
CONF_BELOW,
@ -113,7 +113,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
)
class BayesianBinarySensor(BinarySensorDevice):
class BayesianBinarySensor(BinarySensorEntity):
"""Representation of a Bayesian sensor."""
def __init__(self, name, prior, observations, probability_threshold, device_class):

View File

@ -4,7 +4,7 @@ import logging
import voluptuous as vol
from homeassistant.components import bbb_gpio
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_NAME, DEVICE_DEFAULT_NAME
import homeassistant.helpers.config_validation as cv
@ -44,7 +44,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(binary_sensors)
class BBBGPIOBinarySensor(BinarySensorDevice):
class BBBGPIOBinarySensor(BinarySensorEntity):
"""Representation of a binary sensor that uses Beaglebone Black GPIO."""
def __init__(self, pin, params):

View File

@ -15,6 +15,8 @@ from homeassistant.helpers.entity_component import EntityComponent
# mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
DOMAIN = "binary_sensor"
SCAN_INTERVAL = timedelta(seconds=30)
@ -142,7 +144,7 @@ async def async_unload_entry(hass, entry):
return await hass.data[DOMAIN].async_unload_entry(entry)
class BinarySensorDevice(Entity):
class BinarySensorEntity(Entity):
"""Represent a binary sensor."""
@property
@ -159,3 +161,15 @@ class BinarySensorDevice(Entity):
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
return None
class BinarySensorDevice(BinarySensorEntity):
"""Represent a binary sensor (for backwards compatibility)."""
def __init_subclass__(cls, **kwargs):
"""Print deprecation warning."""
super().__init_subclass__(**kwargs)
_LOGGER.warning(
"BinarySensorDevice is deprecated, modify %s to extend BinarySensorEntity",
cls.__name__,
)

View File

@ -1,5 +1,5 @@
"""Support for Blink system camera control."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_MONITORED_CONDITIONS
from . import BINARY_SENSORS, BLINK_DATA
@ -18,7 +18,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devs, True)
class BlinkBinarySensor(BinarySensorDevice):
class BlinkBinarySensor(BinarySensorEntity):
"""Representation of a Blink binary sensor."""
def __init__(self, data, camera, sensor_type):

View File

@ -3,7 +3,7 @@ import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
@ -33,7 +33,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([BloomSkySensor(bloomsky, device, variable)], True)
class BloomSkySensor(BinarySensorDevice):
class BloomSkySensor(BinarySensorEntity):
"""Representation of a single binary sensor in a BloomSky device."""
def __init__(self, bs, device, sensor_name):

View File

@ -3,7 +3,7 @@ import logging
from bimmer_connected.state import ChargingState, LockState
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import ATTR_ATTRIBUTION, LENGTH_KILOMETERS
from . import DOMAIN as BMW_DOMAIN
@ -54,7 +54,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices, True)
class BMWConnectedDriveSensor(BinarySensorDevice):
class BMWConnectedDriveSensor(BinarySensorEntity):
"""Representation of a BMW vehicle binary sensor."""
def __init__(

View File

@ -1,7 +1,7 @@
"""Support for Home Assistant Cloud binary sensors."""
import asyncio
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import DISPATCHER_REMOTE_UPDATE, DOMAIN
@ -18,7 +18,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([CloudRemoteBinary(cloud)])
class CloudRemoteBinary(BinarySensorDevice):
class CloudRemoteBinary(BinarySensorEntity):
"""Representation of an Cloud Remote UI Connection binary sensor."""
def __init__(self, cloud):

View File

@ -7,7 +7,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import (
CONF_COMMAND,
@ -68,7 +68,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)
class CommandBinarySensor(BinarySensorDevice):
class CommandBinarySensor(BinarySensorEntity):
"""Representation of a command line binary sensor."""
def __init__(

View File

@ -9,7 +9,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import CONF_HOST, CONF_PORT
import homeassistant.helpers.config_validation as cv
@ -95,7 +95,7 @@ def get_opening_type(zone):
return "opening"
class Concord232ZoneSensor(BinarySensorDevice):
class Concord232ZoneSensor(BinarySensorEntity):
"""Representation of a Concord232 zone as a sensor."""
def __init__(self, hass, client, zone, zone_type):

View File

@ -1,7 +1,7 @@
"""Support for the for Danfoss Air HRV binary sensors."""
from pydanfossair.commands import ReadCommand
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import DOMAIN as DANFOSS_AIR_DOMAIN
@ -23,7 +23,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(dev, True)
class DanfossAirBinarySensor(BinarySensorDevice):
class DanfossAirBinarySensor(BinarySensorEntity):
"""Representation of a Danfoss Air binary sensor."""
def __init__(self, data, name, sensor_type, device_class):

View File

@ -1,7 +1,7 @@
"""Support for deCONZ binary sensors."""
from pydeconz.sensor import Presence, Vibration
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import ATTR_TEMPERATURE
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -53,7 +53,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
)
class DeconzBinarySensor(DeconzDevice, BinarySensorDevice):
class DeconzBinarySensor(DeconzDevice, BinarySensorEntity):
"""Representation of a deCONZ binary sensor."""
@callback

View File

@ -1,5 +1,5 @@
"""Demo platform that has two fake binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import DOMAIN
@ -19,7 +19,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
await async_setup_platform(hass, {}, async_add_entities)
class DemoBinarySensor(BinarySensorDevice):
class DemoBinarySensor(BinarySensorEntity):
"""representation of a Demo binary sensor."""
def __init__(self, unique_id, name, state, device_class):

View File

@ -3,7 +3,7 @@ import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import ATTR_ATTRIBUTION
import homeassistant.helpers.config_validation as cv
@ -50,7 +50,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(dev, True)
class DigitalOceanBinarySensor(BinarySensorDevice):
class DigitalOceanBinarySensor(BinarySensorEntity):
"""Representation of a Digital Ocean droplet sensor."""
def __init__(self, do, droplet_id):

View File

@ -1,7 +1,7 @@
"""Support for Ecobee binary sensors."""
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OCCUPANCY,
BinarySensorDevice,
BinarySensorEntity,
)
from .const import _LOGGER, DOMAIN, ECOBEE_MODEL_TO_NAME, MANUFACTURER
@ -22,7 +22,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(dev, True)
class EcobeeBinarySensor(BinarySensorDevice):
class EcobeeBinarySensor(BinarySensorEntity):
"""Representation of an Ecobee sensor."""
def __init__(self, data, sensor_name, sensor_index):

View File

@ -1,7 +1,7 @@
"""Interfaces with Egardia/Woonveilig alarm control panel."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import STATE_OFF, STATE_ON
from . import ATTR_DISCOVER_DEVICES, EGARDIA_DEVICE
@ -38,7 +38,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
)
class EgardiaBinarySensor(BinarySensorDevice):
class EgardiaBinarySensor(BinarySensorEntity):
"""Represents a sensor based on an Egardia sensor (IR, Door Contact)."""
def __init__(self, sensor_id, name, egardia_system, device_class):

View File

@ -1,7 +1,7 @@
"""Support for Eight Sleep binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import CONF_BINARY_SENSORS, DATA_EIGHT, NAME_MAP, EightSleepHeatEntity
@ -25,7 +25,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(all_sensors, True)
class EightHeatSensor(EightSleepHeatEntity, BinarySensorDevice):
class EightHeatSensor(EightSleepHeatEntity, BinarySensorEntity):
"""Representation of a Eight Sleep heat-based sensor."""
def __init__(self, name, eight, sensor):

View File

@ -7,7 +7,7 @@ from homeassistant.components import enocean
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_ID, CONF_NAME
import homeassistant.helpers.config_validation as cv
@ -36,7 +36,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([EnOceanBinarySensor(dev_id, dev_name, device_class)])
class EnOceanBinarySensor(enocean.EnOceanDevice, BinarySensorDevice):
class EnOceanBinarySensor(enocean.EnOceanDevice, BinarySensorEntity):
"""Representation of EnOcean binary sensors such as wall switches.
Supported EEPs (EnOcean Equipment Profiles):

View File

@ -2,7 +2,7 @@
import datetime
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import ATTR_LAST_TRIP_TIME
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -40,7 +40,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(devices)
class EnvisalinkBinarySensor(EnvisalinkDevice, BinarySensorDevice):
class EnvisalinkBinarySensor(EnvisalinkDevice, BinarySensorEntity):
"""Representation of an Envisalink binary sensor."""
def __init__(self, hass, zone_number, zone_name, zone_type, info, controller):

View File

@ -3,7 +3,7 @@ from typing import Optional
from aioesphomeapi import BinarySensorInfo, BinarySensorState
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import EsphomeEntity, platform_async_setup_entry
@ -21,7 +21,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
)
class EsphomeBinarySensor(EsphomeEntity, BinarySensorDevice):
class EsphomeBinarySensor(EsphomeEntity, BinarySensorEntity):
"""A binary sensor implementation for ESPHome."""
@property

View File

@ -4,7 +4,7 @@ import logging
import haffmpeg.sensor as ffmpeg_sensor
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.components.ffmpeg import (
CONF_EXTRA_ARGUMENTS,
CONF_INITIAL_STATE,
@ -55,7 +55,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([entity])
class FFmpegBinarySensor(FFmpegBase, BinarySensorDevice):
class FFmpegBinarySensor(FFmpegBase, BinarySensorEntity):
"""A binary sensor which use FFmpeg for noise detection."""
def __init__(self, config):

View File

@ -1,7 +1,7 @@
"""Support for Fibaro binary sensors."""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity
from homeassistant.const import CONF_DEVICE_CLASS, CONF_ICON
from . import FIBARO_DEVICES, FibaroDevice
@ -33,7 +33,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)
class FibaroBinarySensor(FibaroDevice, BinarySensorDevice):
class FibaroBinarySensor(FibaroDevice, BinarySensorEntity):
"""Representation of a Fibaro Binary Sensor."""
def __init__(self, fibaro_device):

View File

@ -12,7 +12,7 @@ from pyflic import (
)
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
CONF_DISCOVERY,
CONF_HOST,
@ -123,7 +123,7 @@ def setup_button(hass, config, add_entities, client, address):
add_entities([button])
class FlicButton(BinarySensorDevice):
class FlicButton(BinarySensorEntity):
"""Representation of a flic button."""
def __init__(self, hass, client, address, timeout, ignored_click_types):

View File

@ -1,7 +1,7 @@
"""Support for Fritzbox binary sensors."""
import requests
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_DEVICES
from .const import CONF_CONNECTIONS, DOMAIN as FRITZBOX_DOMAIN, LOGGER
@ -21,7 +21,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(entities, True)
class FritzboxBinarySensor(BinarySensorDevice):
class FritzboxBinarySensor(BinarySensorEntity):
"""Representation of a binary Fritzbox device."""
def __init__(self, device, fritz):

View File

@ -1,7 +1,7 @@
"""Support for binary sensor using GC100."""
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import DEVICE_DEFAULT_NAME
import homeassistant.helpers.config_validation as cv
@ -26,7 +26,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(binary_sensors, True)
class GC100BinarySensor(BinarySensorDevice):
class GC100BinarySensor(BinarySensorEntity):
"""Representation of a binary sensor from GC100."""
def __init__(self, name, port_addr, gc100):

View File

@ -1,5 +1,5 @@
"""Support for Genius Hub binary_sensor devices."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
from . import DOMAIN, GeniusDevice
@ -25,7 +25,7 @@ async def async_setup_platform(
async_add_entities(switches, update_before_add=True)
class GeniusBinarySensor(GeniusDevice, BinarySensorDevice):
class GeniusBinarySensor(GeniusDevice, BinarySensorEntity):
"""Representation of a Genius Hub binary_sensor."""
def __init__(self, broker, device, state_attr) -> None:

View File

@ -5,7 +5,7 @@ import logging
from pyhik.hikvision import HikCamera
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
ATTR_LAST_TRIP_TIME,
CONF_CUSTOMIZE,
@ -183,7 +183,7 @@ class HikvisionData:
return self.camdata.fetch_attributes(sensor, channel)
class HikvisionBinarySensor(BinarySensorDevice):
class HikvisionBinarySensor(BinarySensorEntity):
"""Representation of a Hikvision binary sensor."""
def __init__(self, hass, sensor, channel, cam, delay):

View File

@ -1,5 +1,5 @@
"""Support for the Hive binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import DATA_HIVE, DOMAIN, HiveEntity
@ -18,7 +18,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devs)
class HiveBinarySensorEntity(HiveEntity, BinarySensorDevice):
class HiveBinarySensorEntity(HiveEntity, BinarySensorEntity):
"""Representation of a Hive binary sensor."""
@property

View File

@ -9,7 +9,7 @@ from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OCCUPANCY,
DEVICE_CLASS_OPENING,
DEVICE_CLASS_SMOKE,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.core import callback
@ -18,7 +18,7 @@ from . import KNOWN_DEVICES, HomeKitEntity
_LOGGER = logging.getLogger(__name__)
class HomeKitMotionSensor(HomeKitEntity, BinarySensorDevice):
class HomeKitMotionSensor(HomeKitEntity, BinarySensorEntity):
"""Representation of a Homekit motion sensor."""
def get_characteristic_types(self):
@ -36,7 +36,7 @@ class HomeKitMotionSensor(HomeKitEntity, BinarySensorDevice):
return self.service.value(CharacteristicsTypes.MOTION_DETECTED)
class HomeKitContactSensor(HomeKitEntity, BinarySensorDevice):
class HomeKitContactSensor(HomeKitEntity, BinarySensorEntity):
"""Representation of a Homekit contact sensor."""
def get_characteristic_types(self):
@ -54,7 +54,7 @@ class HomeKitContactSensor(HomeKitEntity, BinarySensorDevice):
return self.service.value(CharacteristicsTypes.CONTACT_STATE) == 1
class HomeKitSmokeSensor(HomeKitEntity, BinarySensorDevice):
class HomeKitSmokeSensor(HomeKitEntity, BinarySensorEntity):
"""Representation of a Homekit smoke sensor."""
@property
@ -72,7 +72,7 @@ class HomeKitSmokeSensor(HomeKitEntity, BinarySensorDevice):
return self.service.value(CharacteristicsTypes.SMOKE_DETECTED) == 1
class HomeKitOccupancySensor(HomeKitEntity, BinarySensorDevice):
class HomeKitOccupancySensor(HomeKitEntity, BinarySensorEntity):
"""Representation of a Homekit occupancy sensor."""
@property
@ -90,7 +90,7 @@ class HomeKitOccupancySensor(HomeKitEntity, BinarySensorDevice):
return self.service.value(CharacteristicsTypes.OCCUPANCY_DETECTED) == 1
class HomeKitLeakSensor(HomeKitEntity, BinarySensorDevice):
class HomeKitLeakSensor(HomeKitEntity, BinarySensorEntity):
"""Representation of a Homekit leak sensor."""
def get_characteristic_types(self):

View File

@ -7,7 +7,7 @@ from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OPENING,
DEVICE_CLASS_PRESENCE,
DEVICE_CLASS_SMOKE,
BinarySensorDevice,
BinarySensorEntity,
)
from .const import ATTR_DISCOVER_DEVICES, ATTR_DISCOVERY_TYPE, DISCOVER_BATTERY
@ -48,7 +48,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices, True)
class HMBinarySensor(HMDevice, BinarySensorDevice):
class HMBinarySensor(HMDevice, BinarySensorEntity):
"""Representation of a binary HomeMatic device."""
@property
@ -73,7 +73,7 @@ class HMBinarySensor(HMDevice, BinarySensorDevice):
self._data.update({self._state: None})
class HMBatterySensor(HMDevice, BinarySensorDevice):
class HMBatterySensor(HMDevice, BinarySensorEntity):
"""Representation of an HomeMatic low battery sensor."""
@property

View File

@ -36,7 +36,7 @@ from homeassistant.components.binary_sensor import (
DEVICE_CLASS_PRESENCE,
DEVICE_CLASS_SAFETY,
DEVICE_CLASS_SMOKE,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
@ -131,7 +131,7 @@ async def async_setup_entry(
async_add_entities(entities)
class HomematicipAccelerationSensor(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipAccelerationSensor(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud acceleration sensor."""
@property
@ -157,7 +157,7 @@ class HomematicipAccelerationSensor(HomematicipGenericDevice, BinarySensorDevice
return state_attr
class HomematicipContactInterface(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipContactInterface(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud contact interface."""
@property
@ -173,7 +173,7 @@ class HomematicipContactInterface(HomematicipGenericDevice, BinarySensorDevice):
return self._device.windowState != WindowState.CLOSED
class HomematicipShutterContact(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipShutterContact(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud shutter contact."""
@property
@ -189,7 +189,7 @@ class HomematicipShutterContact(HomematicipGenericDevice, BinarySensorDevice):
return self._device.windowState != WindowState.CLOSED
class HomematicipMotionDetector(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipMotionDetector(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud motion detector."""
@property
@ -203,7 +203,7 @@ class HomematicipMotionDetector(HomematicipGenericDevice, BinarySensorDevice):
return self._device.motionDetected
class HomematicipPresenceDetector(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipPresenceDetector(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud presence detector."""
@property
@ -217,7 +217,7 @@ class HomematicipPresenceDetector(HomematicipGenericDevice, BinarySensorDevice):
return self._device.presenceDetected
class HomematicipSmokeDetector(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipSmokeDetector(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud smoke detector."""
@property
@ -236,7 +236,7 @@ class HomematicipSmokeDetector(HomematicipGenericDevice, BinarySensorDevice):
return False
class HomematicipWaterDetector(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipWaterDetector(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud water detector."""
@property
@ -250,7 +250,7 @@ class HomematicipWaterDetector(HomematicipGenericDevice, BinarySensorDevice):
return self._device.moistureDetected or self._device.waterlevelDetected
class HomematicipStormSensor(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipStormSensor(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud storm sensor."""
def __init__(self, hap: HomematicipHAP, device) -> None:
@ -268,7 +268,7 @@ class HomematicipStormSensor(HomematicipGenericDevice, BinarySensorDevice):
return self._device.storm
class HomematicipRainSensor(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipRainSensor(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud rain sensor."""
def __init__(self, hap: HomematicipHAP, device) -> None:
@ -286,7 +286,7 @@ class HomematicipRainSensor(HomematicipGenericDevice, BinarySensorDevice):
return self._device.raining
class HomematicipSunshineSensor(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipSunshineSensor(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud sunshine sensor."""
def __init__(self, hap: HomematicipHAP, device) -> None:
@ -315,7 +315,7 @@ class HomematicipSunshineSensor(HomematicipGenericDevice, BinarySensorDevice):
return state_attr
class HomematicipBatterySensor(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipBatterySensor(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud low battery sensor."""
def __init__(self, hap: HomematicipHAP, device) -> None:
@ -334,7 +334,7 @@ class HomematicipBatterySensor(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipPluggableMainsFailureSurveillanceSensor(
HomematicipGenericDevice, BinarySensorDevice
HomematicipGenericDevice, BinarySensorEntity
):
"""Representation of a HomematicIP Cloud pluggable mains failure surveillance sensor."""
@ -353,7 +353,7 @@ class HomematicipPluggableMainsFailureSurveillanceSensor(
return not self._device.powerMainsFailure
class HomematicipSecurityZoneSensorGroup(HomematicipGenericDevice, BinarySensorDevice):
class HomematicipSecurityZoneSensorGroup(HomematicipGenericDevice, BinarySensorEntity):
"""Representation of a HomematicIP Cloud security zone group."""
def __init__(self, hap: HomematicipHAP, device, post: str = "SecurityZone") -> None:
@ -409,7 +409,7 @@ class HomematicipSecurityZoneSensorGroup(HomematicipGenericDevice, BinarySensorD
class HomematicipSecuritySensorGroup(
HomematicipSecurityZoneSensorGroup, BinarySensorDevice
HomematicipSecurityZoneSensorGroup, BinarySensorEntity
):
"""Representation of a HomematicIP security group."""

View File

@ -8,7 +8,7 @@ from huawei_lte_api.enums.cradle import ConnectionStatusEnum
from homeassistant.components.binary_sensor import (
DOMAIN as BINARY_SENSOR_DOMAIN,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import CONF_URL
@ -33,7 +33,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
@attr.s
class HuaweiLteBaseBinarySensor(HuaweiLteBaseEntity, BinarySensorDevice):
class HuaweiLteBaseBinarySensor(HuaweiLteBaseEntity, BinarySensorEntity):
"""Huawei LTE binary sensor device base class."""
key: str

View File

@ -4,7 +4,7 @@ from aiohue.sensors import TYPE_ZLL_PRESENCE
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_MOTION,
BinarySensorDevice,
BinarySensorEntity,
)
from .const import DOMAIN as HUE_DOMAIN
@ -20,7 +20,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
].sensor_manager.async_register_component("binary_sensor", async_add_entities)
class HuePresence(GenericZLLSensor, BinarySensorDevice):
class HuePresence(GenericZLLSensor, BinarySensorEntity):
"""The presence sensor entity for a Hue motion sensor device."""
device_class = DEVICE_CLASS_MOTION

View File

@ -3,7 +3,7 @@ import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
@ -47,7 +47,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(sensors, True)
class HydrawiseBinarySensor(HydrawiseEntity, BinarySensorDevice):
class HydrawiseBinarySensor(HydrawiseEntity, BinarySensorEntity):
"""A sensor implementation for Hydrawise device."""
@property

View File

@ -4,7 +4,7 @@ import logging
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_COLD,
DOMAIN,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
@ -27,7 +27,7 @@ async def async_setup_entry(
async_add_entities(devs, True)
class HassAqualinkBinarySensor(AqualinkEntity, BinarySensorDevice):
class HassAqualinkBinarySensor(AqualinkEntity, BinarySensorEntity):
"""Representation of a binary sensor."""
@property

View File

@ -1,5 +1,5 @@
"""Support for IHC binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_TYPE
from . import IHC_CONTROLLER, IHC_INFO
@ -35,7 +35,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices)
class IHCBinarySensor(IHCDevice, BinarySensorDevice):
class IHCBinarySensor(IHCDevice, BinarySensorEntity):
"""IHC Binary Sensor.
The associated IHC resource can be any in or output from a IHC product

View File

@ -3,7 +3,7 @@ from typing import Any, Dict, Optional
from homeassistant.components.binary_sensor import (
DOMAIN as BINARY_SENSOR_DOMAIN,
BinarySensorDevice,
BinarySensorEntity,
)
from . import DOMAIN, IncomfortChild
@ -20,7 +20,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([IncomfortFailed(client, h) for h in heaters])
class IncomfortFailed(IncomfortChild, BinarySensorDevice):
class IncomfortFailed(IncomfortChild, BinarySensorEntity):
"""Representation of an InComfort Failed sensor."""
def __init__(self, client, heater) -> None:

View File

@ -1,7 +1,7 @@
"""Support for INSTEON dimmers via PowerLinc Modem."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from .insteon_entity import InsteonEntity
@ -38,7 +38,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([new_entity])
class InsteonBinarySensor(InsteonEntity, BinarySensorDevice):
class InsteonBinarySensor(InsteonEntity, BinarySensorEntity):
"""A Class for an Insteon device entity."""
def __init__(self, device, state_key):

View File

@ -6,7 +6,7 @@ import pyiss
import requests
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
ATTR_LATITUDE,
ATTR_LONGITUDE,
@ -53,7 +53,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([IssBinarySensor(iss_data, name, show_on_map)], True)
class IssBinarySensor(BinarySensorDevice):
class IssBinarySensor(BinarySensorEntity):
"""Implementation of the ISS binary sensor."""
def __init__(self, iss_data, name, show):

View File

@ -3,7 +3,7 @@ from datetime import timedelta
import logging
from typing import Callable
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import callback
from homeassistant.helpers.event import async_track_point_in_utc_time
@ -31,7 +31,7 @@ def setup_platform(
for node in hass.data[ISY994_NODES][DOMAIN]:
if node.parent_node is None:
device = ISYBinarySensorDevice(node)
device = ISYBinarySensorEntity(node)
devices.append(device)
devices_by_nid[node.nid] = device
else:
@ -66,7 +66,7 @@ def setup_platform(
else:
# We don't yet have any special logic for other sensor types,
# so add the nodes as individual devices
device = ISYBinarySensorDevice(node)
device = ISYBinarySensorEntity(node)
devices.append(device)
for name, status, _ in hass.data[ISY994_PROGRAMS][DOMAIN]:
@ -95,7 +95,7 @@ def _is_val_unknown(val):
return val == -1 * float("inf")
class ISYBinarySensorDevice(ISYDevice, BinarySensorDevice):
class ISYBinarySensorEntity(ISYDevice, BinarySensorEntity):
"""Representation of an ISY994 binary sensor device.
Often times, a single device is represented by multiple nodes in the ISY,
@ -253,7 +253,7 @@ class ISYBinarySensorDevice(ISYDevice, BinarySensorDevice):
return self._device_class_from_type
class ISYBinarySensorHeartbeat(ISYDevice, BinarySensorDevice):
class ISYBinarySensorHeartbeat(ISYDevice, BinarySensorEntity):
"""Representation of the battery state of an ISY994 sensor."""
def __init__(self, node, parent_device) -> None:
@ -353,7 +353,7 @@ class ISYBinarySensorHeartbeat(ISYDevice, BinarySensorDevice):
return attr
class ISYBinarySensorProgram(ISYDevice, BinarySensorDevice):
class ISYBinarySensorProgram(ISYDevice, BinarySensorEntity):
"""Representation of an ISY994 binary sensor program.
This does not need all of the subnode logic in the device version of binary

View File

@ -3,7 +3,7 @@ import logging
import hdate
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
import homeassistant.util.dt as dt_util
from . import DOMAIN, SENSOR_TYPES
@ -24,7 +24,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
)
class JewishCalendarBinarySensor(BinarySensorDevice):
class JewishCalendarBinarySensor(BinarySensorEntity):
"""Representation of an Jewish Calendar binary sensor."""
def __init__(self, data, sensor, sensor_info):

View File

@ -6,7 +6,7 @@ from homeassistant.components.binary_sensor import (
DEVICE_CLASS_PLUG,
DEVICE_CLASS_POWER,
DEVICE_CLASS_SAFETY,
BinarySensorDevice,
BinarySensorEntity,
)
from . import DOMAIN
@ -36,7 +36,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(sensors)
class KebaBinarySensor(BinarySensorDevice):
class KebaBinarySensor(BinarySensorEntity):
"""Representation of a binary sensor of a KEBA charging station."""
def __init__(self, keba, key, name, entity_type, device_class):

View File

@ -2,7 +2,7 @@
import voluptuous as vol
from xknx.devices import BinarySensor
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
@ -102,7 +102,7 @@ def async_add_entities_config(hass, config, async_add_entities):
async_add_entities([entity])
class KNXBinarySensor(BinarySensorDevice):
class KNXBinarySensor(BinarySensorEntity):
"""Representation of a KNX binary sensor."""
def __init__(self, device):

View File

@ -1,7 +1,7 @@
"""Support for wired binary sensors attached to a Konnected device."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_STATE,
@ -31,7 +31,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(sensors)
class KonnectedBinarySensor(BinarySensorDevice):
class KonnectedBinarySensor(BinarySensorEntity):
"""Representation of a Konnected binary sensor."""
def __init__(self, device_id, zone_num, data):

View File

@ -1,7 +1,7 @@
"""Support for LCN binary sensors."""
import pypck
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_ADDRESS
from . import LcnDevice
@ -36,7 +36,7 @@ async def async_setup_platform(
async_add_entities(devices)
class LcnRegulatorLockSensor(LcnDevice, BinarySensorDevice):
class LcnRegulatorLockSensor(LcnDevice, BinarySensorEntity):
"""Representation of a LCN binary sensor for regulator locks."""
def __init__(self, config, address_connection):
@ -71,7 +71,7 @@ class LcnRegulatorLockSensor(LcnDevice, BinarySensorDevice):
self.async_write_ha_state()
class LcnBinarySensor(LcnDevice, BinarySensorDevice):
class LcnBinarySensor(LcnDevice, BinarySensorEntity):
"""Representation of a LCN binary sensor for binary sensor ports."""
def __init__(self, config, address_connection):
@ -103,7 +103,7 @@ class LcnBinarySensor(LcnDevice, BinarySensorDevice):
self.async_write_ha_state()
class LcnLockKeysSensor(LcnDevice, BinarySensorDevice):
class LcnLockKeysSensor(LcnDevice, BinarySensorEntity):
"""Representation of a LCN sensor for key locks."""
def __init__(self, config, address_connection):

View File

@ -3,7 +3,7 @@ import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
import homeassistant.helpers.config_validation as cv
from . import (
@ -44,7 +44,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(dev, True)
class LinodeBinarySensor(BinarySensorDevice):
class LinodeBinarySensor(BinarySensorEntity):
"""Representation of a Linode droplet sensor."""
def __init__(self, li, node_id):

View File

@ -4,7 +4,7 @@ import logging
import lupupy.constants as CONST
from homeassistant.components.binary_sensor import DEVICE_CLASSES, BinarySensorDevice
from homeassistant.components.binary_sensor import DEVICE_CLASSES, BinarySensorEntity
from . import DOMAIN as LUPUSEC_DOMAIN, LupusecDevice
@ -29,7 +29,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices)
class LupusecBinarySensor(LupusecDevice, BinarySensorDevice):
class LupusecBinarySensor(LupusecDevice, BinarySensorEntity):
"""A binary sensor implementation for Lupusec device."""
@property

View File

@ -3,7 +3,7 @@ from pylutron import OccupancyGroup
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OCCUPANCY,
BinarySensorDevice,
BinarySensorEntity,
)
from . import LUTRON_CONTROLLER, LUTRON_DEVICES, LutronDevice
@ -21,7 +21,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devs)
class LutronOccupancySensor(LutronDevice, BinarySensorDevice):
class LutronOccupancySensor(LutronDevice, BinarySensorEntity):
"""Representation of a Lutron Occupancy Group.
The Lutron integration API reports "occupancy groups" rather than

View File

@ -3,7 +3,7 @@ from pylutron_caseta import OCCUPANCY_GROUP_OCCUPIED
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OCCUPANCY,
BinarySensorDevice,
BinarySensorEntity,
)
from . import LUTRON_CASETA_SMARTBRIDGE, LutronCasetaDevice
@ -21,7 +21,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(entities, True)
class LutronOccupancySensor(LutronCasetaDevice, BinarySensorDevice):
class LutronOccupancySensor(LutronCasetaDevice, BinarySensorEntity):
"""Representation of a Lutron occupancy group."""
@property

View File

@ -1,7 +1,7 @@
"""Support for MAX! binary sensors via MAX! Cube."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import DATA_KEY
@ -24,11 +24,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices)
class MaxCubeShutter(BinarySensorDevice):
class MaxCubeShutter(BinarySensorEntity):
"""Representation of a MAX! Cube Binary Sensor device."""
def __init__(self, handler, name, rf_address):
"""Initialize MAX! Cube BinarySensorDevice."""
"""Initialize MAX! Cube BinarySensorEntity."""
self._name = name
self._sensor_type = "window"
self._rf_address = rf_address
@ -42,7 +42,7 @@ class MaxCubeShutter(BinarySensorDevice):
@property
def name(self):
"""Return the name of the BinarySensorDevice."""
"""Return the name of the BinarySensorEntity."""
return self._name
@property

View File

@ -7,7 +7,7 @@ import busio # pylint: disable=import-error
import digitalio # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import DEVICE_DEFAULT_NAME
import homeassistant.helpers.config_validation as cv
@ -60,7 +60,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
add_devices(binary_sensors, True)
class MCP23017BinarySensor(BinarySensorDevice):
class MCP23017BinarySensor(BinarySensorEntity):
"""Represent a binary sensor that uses MCP23017."""
def __init__(self, name, pin, pull_mode, invert_logic):

View File

@ -5,7 +5,7 @@ import logging
from meteoalertapi import Meteoalert
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME
import homeassistant.helpers.config_validation as cv
@ -49,7 +49,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([MeteoAlertBinarySensor(api, name)], True)
class MeteoAlertBinarySensor(BinarySensorDevice):
class MeteoAlertBinarySensor(BinarySensorEntity):
"""Representation of a MeteoAlert binary sensor."""
def __init__(self, api, name):

View File

@ -2,7 +2,7 @@
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
@ -24,7 +24,7 @@ async def async_setup_entry(
async_add_entities(entities, True)
class MinecraftServerStatusBinarySensor(MinecraftServerEntity, BinarySensorDevice):
class MinecraftServerStatusBinarySensor(MinecraftServerEntity, BinarySensorEntity):
"""Representation of a Minecraft Server status binary sensor."""
def __init__(self, server: MinecraftServer) -> None:

View File

@ -1,7 +1,7 @@
"""Binary sensor platform for mobile_app."""
from functools import partial
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -57,7 +57,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
)
class MobileAppBinarySensor(MobileAppEntity, BinarySensorDevice):
class MobileAppBinarySensor(MobileAppEntity, BinarySensorEntity):
"""Representation of an mobile app binary sensor."""
@property

View File

@ -9,7 +9,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME, CONF_SLAVE
from homeassistant.helpers import config_validation as cv
@ -73,7 +73,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(sensors)
class ModbusBinarySensor(BinarySensorDevice):
class ModbusBinarySensor(BinarySensorEntity):
"""Modbus binary sensor."""
def __init__(self, hub, name, slave, address, device_class, input_type):

View File

@ -7,7 +7,7 @@ import voluptuous as vol
from homeassistant.components import binary_sensor, mqtt
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import (
CONF_DEVICE,
@ -107,7 +107,7 @@ class MqttBinarySensor(
MqttAvailability,
MqttDiscoveryUpdate,
MqttEntityDeviceInfo,
BinarySensorDevice,
BinarySensorEntity,
):
"""Representation a binary sensor that is updated by MQTT."""

View File

@ -3,7 +3,7 @@ import logging
from homeassistant.components.binary_sensor import (
DOMAIN as BINARY_SENSOR_DOMAIN,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.core import callback
from homeassistant.util import slugify
@ -29,7 +29,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(sensors)
class EVBinarySensor(BinarySensorDevice):
class EVBinarySensor(BinarySensorEntity):
"""Base EVSensor class.
The only real difference between sensors is which units and what

View File

@ -3,7 +3,7 @@ import logging
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
BinarySensorDevice,
BinarySensorEntity,
)
from .const import (
@ -31,12 +31,12 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
for device in myq.devices.values():
if device.device_json[MYQ_DEVICE_FAMILY] == MYQ_DEVICE_FAMILY_GATEWAY:
entities.append(MyQBinarySensorDevice(coordinator, device))
entities.append(MyQBinarySensorEntity(coordinator, device))
async_add_entities(entities, True)
class MyQBinarySensorDevice(BinarySensorDevice):
class MyQBinarySensorEntity(BinarySensorEntity):
"""Representation of a MyQ gateway."""
def __init__(self, coordinator, device):

View File

@ -3,7 +3,7 @@ from homeassistant.components import mysensors
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES,
DOMAIN,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import STATE_ON
@ -30,7 +30,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
)
class MySensorsBinarySensor(mysensors.device.MySensorsEntity, BinarySensorDevice):
class MySensorsBinarySensor(mysensors.device.MySensorsEntity, BinarySensorEntity):
"""Representation of a MySensors Binary Sensor child node."""
@property

View File

@ -1,7 +1,7 @@
"""Support for the myStrom buttons."""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY
from homeassistant.core import callback
@ -59,7 +59,7 @@ class MyStromView(HomeAssistantView):
self.buttons[entity_id].async_on_update(new_state)
class MyStromBinarySensor(BinarySensorDevice):
class MyStromBinarySensor(BinarySensorEntity):
"""Representation of a myStrom button."""
def __init__(self, button_id):

View File

@ -1,7 +1,7 @@
"""Support for Ness D8X/D16X zone states - represented as binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -38,7 +38,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(devices)
class NessZoneBinarySensor(BinarySensorDevice):
class NessZoneBinarySensor(BinarySensorEntity):
"""Representation of an Ness alarm zone as a binary sensor."""
def __init__(self, zone_id, name, zone_type):

View File

@ -2,7 +2,7 @@
from itertools import chain
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_MONITORED_CONDITIONS
from . import CONF_BINARY_SENSORS, DATA_NEST, DATA_NEST_CONFIG, NestSensorDevice
@ -114,7 +114,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
async_add_entities(await hass.async_add_job(get_binary_sensors), True)
class NestBinarySensor(NestSensorDevice, BinarySensorDevice):
class NestBinarySensor(NestSensorDevice, BinarySensorEntity):
"""Represents a Nest binary sensor."""
@property

View File

@ -1,7 +1,7 @@
"""Support for Netgear LTE binary sensors."""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity
from homeassistant.exceptions import PlatformNotReady
from . import CONF_MONITORED_CONDITIONS, DATA_KEY, LTEEntity
@ -30,7 +30,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info)
async_add_entities(binary_sensors)
class LTEBinarySensor(LTEEntity, BinarySensorDevice):
class LTEBinarySensor(LTEEntity, BinarySensorEntity):
"""Netgear LTE binary sensor entity."""
@property

View File

@ -1,6 +1,6 @@
"""Support for Nexia / Trane XL Thermostats."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from .const import DOMAIN, NEXIA_DEVICE, UPDATE_COORDINATOR
from .entity import NexiaThermostatEntity
@ -34,7 +34,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(entities, True)
class NexiaBinarySensor(NexiaThermostatEntity, BinarySensorDevice):
class NexiaBinarySensor(NexiaThermostatEntity, BinarySensorEntity):
"""Provices Nexia BinarySensor support."""
def __init__(self, coordinator, thermostat, sensor_call, sensor_name):

View File

@ -1,7 +1,7 @@
"""Summary binary data from Nextcoud."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import BINARY_SENSORS, DOMAIN
@ -19,7 +19,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(binary_sensors, True)
class NextcloudBinarySensor(BinarySensorDevice):
class NextcloudBinarySensor(BinarySensorEntity):
"""Represents a Nextcloud binary sensor."""
def __init__(self, item):

View File

@ -1,7 +1,7 @@
"""Plugged In Status Support for the Nissan Leaf."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import DATA_CHARGING, DATA_LEAF, DATA_PLUGGED_IN, LeafEntity
@ -22,7 +22,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices, True)
class LeafPluggedInSensor(LeafEntity, BinarySensorDevice):
class LeafPluggedInSensor(LeafEntity, BinarySensorEntity):
"""Plugged In Sensor class."""
@property
@ -43,7 +43,7 @@ class LeafPluggedInSensor(LeafEntity, BinarySensorDevice):
return "mdi:power-plug-off"
class LeafChargingSensor(LeafEntity, BinarySensorDevice):
class LeafChargingSensor(LeafEntity, BinarySensorEntity):
"""Charging Sensor class."""
@property

View File

@ -1,7 +1,7 @@
"""Support for Notion binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.core import callback
from . import (
@ -50,7 +50,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
async_add_entities(sensor_list, True)
class NotionBinarySensor(NotionEntity, BinarySensorDevice):
class NotionBinarySensor(NotionEntity, BinarySensorEntity):
"""Define a Notion sensor."""
@property

View File

@ -10,7 +10,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import CONF_HOST, CONF_PORT
import homeassistant.helpers.config_validation as cv
@ -72,7 +72,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
return True
class NX584ZoneSensor(BinarySensorDevice):
class NX584ZoneSensor(BinarySensorEntity):
"""Representation of a NX584 zone as a sensor."""
def __init__(self, zone, zone_type):

View File

@ -3,7 +3,7 @@ import logging
import requests
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import BINARY_SENSOR_TYPES, DOMAIN as COMPONENT_DOMAIN
@ -36,7 +36,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices, True)
class OctoPrintBinarySensor(BinarySensorDevice):
class OctoPrintBinarySensor(BinarySensorEntity):
"""Representation an OctoPrint binary sensor."""
def __init__(

View File

@ -1,7 +1,7 @@
"""Support for OpenTherm Gateway binary sensors."""
import logging
from homeassistant.components.binary_sensor import ENTITY_ID_FORMAT, BinarySensorDevice
from homeassistant.components.binary_sensor import ENTITY_ID_FORMAT, BinarySensorEntity
from homeassistant.const import CONF_ID
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -31,7 +31,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(sensors)
class OpenThermBinarySensor(BinarySensorDevice):
class OpenThermBinarySensor(BinarySensorEntity):
"""Represent an OpenTherm Gateway binary sensor."""
def __init__(self, gw_dev, var, device_class, friendly_name_format):

View File

@ -1,7 +1,7 @@
"""Support for OpenUV binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.core import callback
from homeassistant.util.dt import as_local, parse_datetime, utcnow
@ -37,7 +37,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
async_add_entities(binary_sensors, True)
class OpenUvBinarySensor(OpenUvEntity, BinarySensorDevice):
class OpenUvBinarySensor(OpenUvEntity, BinarySensorEntity):
"""Define a binary sensor for OpenUV."""
def __init__(self, openuv, sensor_type, name, icon, entry_id):

View File

@ -1,6 +1,6 @@
"""Support for binary sensor using Orange Pi GPIO."""
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from . import edge_detect, read_input, setup_input, setup_mode
from .const import CONF_INVERT_LOGIC, CONF_PIN_MODE, CONF_PORTS, PORT_SCHEMA
@ -24,7 +24,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(binary_sensors)
class OPiGPIOBinarySensor(BinarySensorDevice):
class OPiGPIOBinarySensor(BinarySensorEntity):
"""Represent a binary sensor that uses Orange Pi GPIO."""
def __init__(self, hass, name, port, invert_logic):

View File

@ -4,7 +4,7 @@ import logging
from pcal9535a import PCAL9535A
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import DEVICE_DEFAULT_NAME
import homeassistant.helpers.config_validation as cv
@ -61,7 +61,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(binary_sensors, True)
class PCAL9535ABinarySensor(BinarySensorDevice):
class PCAL9535ABinarySensor(BinarySensorEntity):
"""Represent a binary sensor that uses PCAL9535A."""
def __init__(self, name, pin, pull_mode, invert_logic):

View File

@ -4,7 +4,7 @@ import logging
from pi4ioe5v9xxxx import pi4ioe5v9xxxx # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import DEVICE_DEFAULT_NAME
import homeassistant.helpers.config_validation as cv
@ -54,7 +54,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(binary_sensors, True)
class Pi4ioe5v9BinarySensor(BinarySensorDevice):
class Pi4ioe5v9BinarySensor(BinarySensorEntity):
"""Represent a binary sensor that uses pi4ioe5v9xxxx IO expander in read mode."""
def __init__(self, name, pin, invert_logic):

View File

@ -5,7 +5,7 @@ import logging
import voluptuous as vol
from homeassistant.components import pilight
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
CONF_DISARM_AFTER_TRIGGER,
CONF_NAME,
@ -72,7 +72,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)
class PilightBinarySensor(BinarySensorDevice):
class PilightBinarySensor(BinarySensorEntity):
"""Representation of a binary sensor that can be updated using Pilight."""
def __init__(self, hass, name, variable, payload, on_value, off_value):
@ -121,7 +121,7 @@ class PilightBinarySensor(BinarySensorDevice):
self.schedule_update_ha_state()
class PilightTriggerSensor(BinarySensorDevice):
class PilightTriggerSensor(BinarySensorEntity):
"""Representation of a binary sensor that can be updated using Pilight."""
def __init__(

View File

@ -7,7 +7,7 @@ import sys
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_HOST, CONF_NAME
import homeassistant.helpers.config_validation as cv
@ -54,7 +54,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([PingBinarySensor(name, PingData(host, count))], True)
class PingBinarySensor(BinarySensorDevice):
class PingBinarySensor(BinarySensorEntity):
"""Representation of a Ping Binary sensor."""
def __init__(self, name, ping):

View File

@ -1,7 +1,7 @@
"""Support for Minut Point binary sensors."""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -63,7 +63,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
)
class MinutPointBinarySensor(MinutPointEntity, BinarySensorDevice):
class MinutPointBinarySensor(MinutPointEntity, BinarySensorEntity):
"""The platform class required by Home Assistant."""
def __init__(self, point_client, device_id, device_class):

View File

@ -6,7 +6,7 @@ from tesla_powerwall import GridStatus
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_BATTERY_CHARGING,
DEVICE_CLASS_CONNECTIVITY,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import DEVICE_CLASS_POWER
@ -56,7 +56,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(entities, True)
class PowerWallRunningSensor(PowerWallEntity, BinarySensorDevice):
class PowerWallRunningSensor(PowerWallEntity, BinarySensorEntity):
"""Representation of an Powerwall running sensor."""
@property
@ -89,7 +89,7 @@ class PowerWallRunningSensor(PowerWallEntity, BinarySensorDevice):
}
class PowerWallConnectedSensor(PowerWallEntity, BinarySensorDevice):
class PowerWallConnectedSensor(PowerWallEntity, BinarySensorEntity):
"""Representation of an Powerwall connected sensor."""
@property
@ -113,7 +113,7 @@ class PowerWallConnectedSensor(PowerWallEntity, BinarySensorDevice):
return self._coordinator.data[POWERWALL_API_SITEMASTER].connected_to_tesla
class PowerWallGridStatusSensor(PowerWallEntity, BinarySensorDevice):
class PowerWallGridStatusSensor(PowerWallEntity, BinarySensorEntity):
"""Representation of an Powerwall grid status sensor."""
@property
@ -137,7 +137,7 @@ class PowerWallGridStatusSensor(PowerWallEntity, BinarySensorDevice):
return self._coordinator.data[POWERWALL_API_GRID_STATUS] == GridStatus.CONNECTED
class PowerWallChargingStatusSensor(PowerWallEntity, BinarySensorDevice):
class PowerWallChargingStatusSensor(PowerWallEntity, BinarySensorEntity):
"""Representation of an Powerwall charging status sensor."""
@property

View File

@ -1,7 +1,7 @@
"""Binary sensor to read Proxmox VE data."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import ATTR_ATTRIBUTION, CONF_HOST, CONF_PORT
from . import CONF_CONTAINERS, CONF_NODES, CONF_VMS, PROXMOX_CLIENTS, ProxmoxItemType
@ -42,7 +42,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(sensors, True)
class ProxmoxBinarySensor(BinarySensorDevice):
class ProxmoxBinarySensor(BinarySensorEntity):
"""A binary sensor for reading Proxmox VE data."""
def __init__(self, proxmox_client, item_node, item_type, item_id):

View File

@ -3,7 +3,7 @@ import logging
from pyqwikswitch.qwikswitch import SENSORS
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.core import callback
from . import DOMAIN as QWIKSWITCH, QSEntity
@ -22,7 +22,7 @@ async def async_setup_platform(hass, _, add_entities, discovery_info=None):
add_entities(devs)
class QSBinarySensor(QSEntity, BinarySensorDevice):
class QSBinarySensor(QSEntity, BinarySensorEntity):
"""Sensor based on a Qwikswitch relay/dimmer module."""
_val = False

View File

@ -4,7 +4,7 @@ import logging
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -38,7 +38,7 @@ def _create_entities(hass, config_entry):
return entities
class RachioControllerBinarySensor(RachioDevice, BinarySensorDevice):
class RachioControllerBinarySensor(RachioDevice, BinarySensorEntity):
"""Represent a binary sensor that reflects a Rachio state."""
def __init__(self, controller, poll=True):

View File

@ -3,7 +3,7 @@ import logging
from pyrainbird import RainbirdController
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import (
DATA_RAINBIRD,
@ -27,7 +27,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)
class RainBirdSensor(BinarySensorDevice):
class RainBirdSensor(BinarySensorEntity):
"""A sensor implementation for Rain Bird device."""
def __init__(self, controller: RainbirdController, sensor_type):

View File

@ -3,7 +3,7 @@ import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
@ -41,7 +41,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
return True
class RainCloudBinarySensor(RainCloudEntity, BinarySensorDevice):
class RainCloudBinarySensor(RainCloudEntity, BinarySensorEntity):
"""A sensor implementation for raincloud device."""
@property

View File

@ -1,7 +1,7 @@
"""This platform provides binary sensors for key RainMachine data."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -86,7 +86,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
)
class RainMachineBinarySensor(RainMachineEntity, BinarySensorDevice):
class RainMachineBinarySensor(RainMachineEntity, BinarySensorEntity):
"""A sensor implementation for raincloud device."""
def __init__(

View File

@ -7,7 +7,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
import homeassistant.helpers.config_validation as cv
@ -32,7 +32,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([RandomSensor(name, device_class)], True)
class RandomSensor(BinarySensorDevice):
class RandomSensor(BinarySensorEntity):
"""Representation of a Random binary sensor."""
def __init__(self, name, device_class):

View File

@ -3,7 +3,7 @@ import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
CONF_ADDRESS,
CONF_DEVICE_CLASS,
@ -81,7 +81,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(binary_sensors)
class I2CHatBinarySensor(BinarySensorDevice):
class I2CHatBinarySensor(BinarySensorEntity):
"""Representation of a binary sensor that uses a I2C-HAT digital input."""
I2C_HATS_MANAGER = None

View File

@ -4,7 +4,7 @@ import logging
import requests
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_HOST
import homeassistant.helpers.config_validation as cv
@ -57,7 +57,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices, True)
class RemoteRPiGPIOBinarySensor(BinarySensorDevice):
class RemoteRPiGPIOBinarySensor(BinarySensorEntity):
"""Represent a binary sensor that uses a Remote Raspberry Pi GPIO."""
def __init__(self, name, button, invert_logic):

View File

@ -7,7 +7,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import (
CONF_AUTHENTICATION,
@ -91,7 +91,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([RestBinarySensor(hass, rest, name, device_class, value_template)])
class RestBinarySensor(BinarySensorDevice):
class RestBinarySensor(BinarySensorEntity):
"""Representation of a REST binary sensor."""
def __init__(self, hass, rest, name, device_class, value_template):

View File

@ -6,7 +6,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_FORCE_UPDATE, CONF_NAME
import homeassistant.helpers.config_validation as cv
@ -56,7 +56,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(devices_from_config(config))
class RflinkBinarySensor(RflinkDevice, BinarySensorDevice):
class RflinkBinarySensor(RflinkDevice, BinarySensorEntity):
"""Representation of an Rflink binary sensor."""
def __init__(

View File

@ -7,7 +7,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
BinarySensorEntity,
)
from homeassistant.const import (
CONF_COMMAND_OFF,
@ -171,7 +171,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
RECEIVED_EVT_SUBSCRIBERS.append(binary_sensor_update)
class RfxtrxBinarySensor(BinarySensorDevice):
class RfxtrxBinarySensor(BinarySensorEntity):
"""A representation of a RFXtrx binary sensor."""
def __init__(

Some files were not shown because too many files have changed in this diff Show More