Skip to content

Commit

Permalink
Merge pull request #190 from ocrease/TimerHold-182-v2
Browse files Browse the repository at this point in the history
Fix for timer hold service targeting all switch entities on device
  • Loading branch information
MindrustUK authored Oct 23, 2024
2 parents d72a7a4 + cb5f2cd commit 33ea8c4
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 33ea8c4

Please # to comment.