Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix for timer hold service targeting all switch entities on device #190

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions custom_components/heatmiserneo/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

from datetime import time
from enum import IntFlag
import logging

import voluptuous as vol
Expand Down Expand Up @@ -76,9 +77,16 @@ async def async_setup_entry(hass, entry, async_add_entities):
vol.Required(ATTR_HOLD_DURATION, default=1): cv.positive_time_period,
},
"async_turn_on",
[HeatmiseerNeoSwitchEntityFeature.HOLD],
)


class HeatmiseerNeoSwitchEntityFeature(IntFlag):
"""Supported features of the heatmiser neo switches entity."""

HOLD = 1


class HeatmiserNeoPlugPowerSwitch(CoordinatorEntity, SwitchEntity):
"""Represents a Heatmiser Neo Plug"""

Expand Down Expand Up @@ -411,6 +419,8 @@ async def async_turn_off(self, **kwargs):
class NeoTimerEntity(CoordinatorEntity, SwitchEntity):
"""Represents a Heatmiser neoStat thermostat acting in TimeClock mode."""

_attr_supported_features = HeatmiseerNeoSwitchEntityFeature.HOLD

def __init__(
self, neostat: NeoStat, coordinator: DataUpdateCoordinator, hub: NeoHub
):
Expand Down