-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Use DeviceClass Enum in alarmdecoder schema #61967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hey there @ajschmidt8, mind taking a look at this pull request as it has been labeled with an integration ( |
@epenet, can you provide a description of these changes? i.e. What's the impact? Why were they made? |
core/homeassistant/components/binary_sensor/__init__.py Lines 118 to 122 in 574f0fc
|
@epenet I'm not sure how the flow form renders a |
|
@epenet, I just tested this locally and I can confirm that config flow does not render the enums correctly. Let me see if I can figure out a quick fix. |
The following changes seem to fix it locally. It essentially just inlines the previous diff --git a/homeassistant/components/alarmdecoder/config_flow.py b/homeassistant/components/alarmdecoder/config_flow.py
index 37ff5b9799..eab2850d07 100644
--- a/homeassistant/components/alarmdecoder/config_flow.py
+++ b/homeassistant/components/alarmdecoder/config_flow.py
@@ -7,9 +7,7 @@ from alarmdecoder.util import NoDeviceError
import voluptuous as vol
from homeassistant import config_entries
-from homeassistant.components.binary_sensor import (
- DEVICE_CLASSES_SCHEMA as BINARY_SENSOR_DEVICE_CLASSES_SCHEMA,
-)
+from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_PROTOCOL
from homeassistant.core import callback
@@ -250,7 +248,7 @@ class AlarmDecoderOptionsFlowHandler(config_entries.OptionsFlow):
default=existing_zone_settings.get(
CONF_ZONE_TYPE, DEFAULT_ZONE_TYPE
),
- ): BINARY_SENSOR_DEVICE_CLASSES_SCHEMA,
+ ): vol.In([cls.value for cls in BinarySensorDeviceClass]),
vol.Optional(
CONF_ZONE_RFID,
description={ |
7589972
to
15d2942
Compare
Hi I have just rebased my branch on latest dev. Could you please try again? |
@epenet, yup. that fixed it. confirmed working now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed working locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Proposed change
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: