From 5454c5467d096a0440e30a1fe8391655949601c5 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:15:54 +0100 Subject: [PATCH] Use new enums in nx584 (#61948) --- homeassistant/components/nx584/binary_sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/nx584/binary_sensor.py b/homeassistant/components/nx584/binary_sensor.py index 38787afb080..236021ab40f 100644 --- a/homeassistant/components/nx584/binary_sensor.py +++ b/homeassistant/components/nx584/binary_sensor.py @@ -8,9 +8,9 @@ import requests import voluptuous as vol from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_OPENING, - DEVICE_CLASSES, + DEVICE_CLASSES_SCHEMA as BINARY_SENSOR_DEVICE_CLASSES_SCHEMA, PLATFORM_SCHEMA, + BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.const import CONF_HOST, CONF_PORT @@ -25,7 +25,7 @@ DEFAULT_HOST = "localhost" DEFAULT_PORT = "5007" DEFAULT_SSL = False -ZONE_TYPES_SCHEMA = vol.Schema({cv.positive_int: vol.In(DEVICE_CLASSES)}) +ZONE_TYPES_SCHEMA = vol.Schema({cv.positive_int: BINARY_SENSOR_DEVICE_CLASSES_SCHEMA}) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { @@ -61,7 +61,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): zone_sensors = { zone["number"]: NX584ZoneSensor( - zone, zone_types.get(zone["number"], DEVICE_CLASS_OPENING) + zone, zone_types.get(zone["number"], BinarySensorDeviceClass.OPENING) ) for zone in zones if zone["number"] not in exclude