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

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