Skip to content
Open
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
2 changes: 1 addition & 1 deletion tests/data/devices/inovelli-vzm36.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
"unique_id": "ab:cd:ef:12:25:9f:47:fc-2-514",
"migrate_unique_ids": [],
"platform": "fan",
"class_name": "Fan",
"class_name": "InovelliFan",
"translation_key": "fan",
"translation_placeholders": null,
"device_class": null,
Expand Down
39 changes: 38 additions & 1 deletion zha/application/platforms/fan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
AttributeWrittenEvent,
ReportingConfig,
)
from zigpy.zcl.clusters import hvac
from zigpy.zcl.clusters import general, hvac

from zha.application import Platform
from zha.application.helpers import safe_read, write_attributes_safe
Expand Down Expand Up @@ -585,3 +585,40 @@ def speed_range(self) -> tuple[int, int]:
def preset_modes_to_name(self) -> dict[int, str]:
"""Return a dict from preset mode to name."""
return {6: PRESET_MODE_SMART}


@register_entity(hvac.Fan.cluster_id)
class InovelliFan(Fan):
"""Representation of an Inovelli fan."""

_cluster_match = ClusterMatch(
server_clusters=frozenset({hvac.Fan.cluster_id}),
manufacturers=frozenset({"Inovelli"}),
models=frozenset(
{
"VZM35-SN",
"VZM36",
}
),
feature_priority=(PlatformFeatureGroup.THERMOSTAT_FAN, 1),
)

async def async_turn_on(
self,
speed: str | None = None,
percentage: int | None = None,
preset_mode: str | None = None,
) -> None:
"""Turn the entity on."""
if speed is None and percentage is None and preset_mode is None:
on_off_cluster = self.endpoint.zigpy_endpoint.in_clusters[
general.OnOff.cluster_id
]
await on_off_cluster.on()
return

await super().async_turn_on(
speed=speed,
percentage=percentage,
preset_mode=preset_mode,
)