diff --git a/homeassistant/components/myq/binary_sensor.py b/homeassistant/components/myq/binary_sensor.py index 2cb35d351c4..0fe1c546890 100644 --- a/homeassistant/components/myq/binary_sensor.py +++ b/homeassistant/components/myq/binary_sensor.py @@ -1,9 +1,9 @@ """Support for MyQ gateways.""" from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_CONNECTIVITY, + BinarySensorDeviceClass, BinarySensorEntity, ) -from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC +from homeassistant.helpers.entity import EntityCategory from . import MyQEntity from .const import DOMAIN, MYQ_COORDINATOR, MYQ_GATEWAY @@ -26,8 +26,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities): class MyQBinarySensorEntity(MyQEntity, BinarySensorEntity): """Representation of a MyQ gateway.""" - _attr_device_class = DEVICE_CLASS_CONNECTIVITY - _attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC + _attr_device_class = BinarySensorDeviceClass.CONNECTIVITY + _attr_entity_category = EntityCategory.DIAGNOSTIC @property def name(self): diff --git a/homeassistant/components/myq/cover.py b/homeassistant/components/myq/cover.py index 4379137b3f1..02876524c50 100644 --- a/homeassistant/components/myq/cover.py +++ b/homeassistant/components/myq/cover.py @@ -3,10 +3,9 @@ from pymyq.const import DEVICE_TYPE_GATE as MYQ_DEVICE_TYPE_GATE from pymyq.errors import MyQError from homeassistant.components.cover import ( - DEVICE_CLASS_GARAGE, - DEVICE_CLASS_GATE, SUPPORT_CLOSE, SUPPORT_OPEN, + CoverDeviceClass, CoverEntity, ) from homeassistant.const import STATE_CLOSED, STATE_CLOSING, STATE_OPEN, STATE_OPENING @@ -37,9 +36,9 @@ class MyQCover(MyQEntity, CoverEntity): super().__init__(coordinator, device) self._device = device if device.device_type == MYQ_DEVICE_TYPE_GATE: - self._attr_device_class = DEVICE_CLASS_GATE + self._attr_device_class = CoverDeviceClass.GATE else: - self._attr_device_class = DEVICE_CLASS_GARAGE + self._attr_device_class = CoverDeviceClass.GARAGE self._attr_unique_id = device.device_id @property