Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Add turn on feature flag to fan #216

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
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
15 changes: 3 additions & 12 deletions fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@

PARALLEL_UPDATES = 0
_LOGGER = logging.getLogger(__name__)
PRESET_VALUES = {
"Normal": 0,
"Speed 1": 1,
"Speed 2": 2,
"Speed 3": 3,
"Speed 4": 4
}
PRESET_VALUES = {"Normal": 0, "Speed 1": 1, "Speed 2": 2, "Speed 3": 3, "Speed 4": 4}
PRESET_NAMES = list(PRESET_VALUES.keys())


Expand All @@ -49,6 +43,8 @@ async def add_active(system: NibeSystem):
class NibeFan(NibeEntity, FanEntity):
"""Nibe Sensor."""

_attr_supported_features = FanEntityFeature.PRESET_MODE | FanEntityFeature.TURN_ON

def __init__(self, system: NibeSystem, ventilation: VentilationSystem):
"""Init."""
parameters = {
Expand Down Expand Up @@ -130,8 +126,3 @@ async def async_set_preset_mode(self, preset_mode: str) -> None:
def unique_id(self) -> str:
"""Return a unique identifier for a this parameter."""
return f"{self._system_id}_{self._ventilation.fan_speed}"

@property
def supported_features(self) -> int | None:
"""Return supported features."""
return FanEntityFeature.PRESET_MODE
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Nibe Uplink",
"content_in_root": true,
"iot_class": "Cloud Polling",
"homeassistant": "2024.2.0b0",
"homeassistant": "2024.8.0b1",
"domains": [
"binary_sensor",
"climate",
Expand Down