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 authored and GitHub committed 2020-04-23 21:57:07 +02:00
1 parent 0b64f49e3a
commit b022e08db9
147 files changed
+371 -352

No files matched your search

@@ -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