Skip to content

Commit

Permalink
DuoFern Window/Door Contact has no states if tilt status is selected
Browse files Browse the repository at this point in the history
Fixes #75
  • Loading branch information
peribeir committed Jun 13, 2023
1 parent e0fb629 commit 9e6f98e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/rademacher/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/peribeir/homeassistant-rademacher/issues",
"requirements": ["pyrademacher==0.9.16"],
"version": "1.12.2"
"version": "1.12.3"
}
4 changes: 4 additions & 0 deletions custom_components/rademacher/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
HomePilotSensorEntity(
coordinator=coordinator,
device=device,
device_class=SensorDeviceClass.ENUM.value,
id_suffix="contact_state",
name_suffix="Contact State",
value_attr="contact_state_value",
Expand All @@ -149,6 +150,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
if val == ContactState.TILTED
else "mdi:square"
),
options=["Open", "Tilted", "Closed"]
)
)
if isinstance(device, HomePilotSensor) or isinstance(
Expand Down Expand Up @@ -190,6 +192,7 @@ def __init__(
icon=None,
icon_template=None,
entity_category=None,
options=None,
) -> None:
super().__init__(
coordinator,
Expand All @@ -203,6 +206,7 @@ def __init__(
self._value_attr = value_attr
self._icon_template = icon_template
self._native_unit_of_measurement = native_unit_of_measurement
self._attr_options = options

@property
def value_attr(self):
Expand Down

0 comments on commit 9e6f98e

Please sign in to comment.