Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update Inovelli Blue Series switch support in ZHA #91254

Merged
merged 6 commits into from
Apr 12, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,20 @@ class InovelliConfigEntityChannel(ZigbeeChannel):
"active_energy_reports": True,
"power_type": False,
"switch_type": False,
"increased_non_neutral_output": True,
"button_delay": False,
"smart_bulb_mode": False,
"double_tap_up_for_max_brightness": True,
"double_tap_down_for_min_brightness": True,
"double_tap_up_enabled": True,
"double_tap_down_enabled": True,
"double_tap_up_level": True,
"double_tap_down_level": True,
"led_color_when_on": True,
"led_color_when_off": True,
"led_intensity_when_on": True,
"led_intensity_when_off": True,
"led_scaling_mode": True,
"aux_switch_scenes": True,
"binding_off_to_on_sync_level": True,
"local_protection": False,
"output_mode": False,
"on_off_led_mode": True,
Expand Down
28 changes: 28 additions & 0 deletions homeassistant/components/zha/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,34 @@ class InovelliDefaultAllLEDOffIntensity(
_attr_name: str = "Default all LED off intensity"


@CONFIG_DIAGNOSTIC_MATCH(channel_names=CHANNEL_INOVELLI)
class InovelliDoubleTapUpLevel(
ZHANumberConfigurationEntity, id_suffix="double_tap_up_level"
):
"""Inovelli double tap up level configuration entity."""

_attr_entity_category = EntityCategory.CONFIG
_attr_icon: str = ICONS[16]
_attr_native_min_value: float = 2
_attr_native_max_value: float = 254
_zcl_attribute: str = "double_tap_up_level"
_attr_name: str = "Double tap up level"


@CONFIG_DIAGNOSTIC_MATCH(channel_names=CHANNEL_INOVELLI)
class InovelliDoubleTapDownLevel(
ZHANumberConfigurationEntity, id_suffix="double_tap_down_level"
):
"""Inovelli double tap down level configuration entity."""

_attr_entity_category = EntityCategory.CONFIG
_attr_icon: str = ICONS[16]
_attr_native_min_value: float = 0
_attr_native_max_value: float = 254
_zcl_attribute: str = "double_tap_down_level"
_attr_name: str = "Double tap down level"


@CONFIG_DIAGNOSTIC_MATCH(channel_names="opple_cluster", models={"aqara.feeder.acn001"})
class AqaraPetFeederServingSize(ZHANumberConfigurationEntity, id_suffix="serving_size"):
"""Aqara pet feeder serving size configuration entity."""
Expand Down
41 changes: 40 additions & 1 deletion homeassistant/components/zha/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,10 @@ class InovelliOutputModeEntity(ZCLEnumSelectEntity, id_suffix="output_mode"):
class InovelliSwitchType(types.enum8):
"""Inovelli output mode."""

Load_Only = 0x00
Single_Pole = 0x00
Three_Way_Dumb = 0x01
Three_Way_AUX = 0x02
Single_Pole_Full_Sine = 0x03


@CONFIG_DIAGNOSTIC_MATCH(
Expand All @@ -488,6 +489,44 @@ class InovelliSwitchTypeEntity(ZCLEnumSelectEntity, id_suffix="switch_type"):
_attr_name: str = "Switch type"


class InovelliLedScalingMode(types.enum1):
"""Inovelli led mode."""

VZM31SN = 0x00
LZW31SN = 0x01


@CONFIG_DIAGNOSTIC_MATCH(
channel_names=CHANNEL_INOVELLI,
)
class InovelliLedScalingModeEntity(ZCLEnumSelectEntity, id_suffix="led_scaling_mode"):
"""Inovelli led mode control."""

_select_attr = "led_scaling_mode"
_enum = InovelliLedScalingMode
_attr_name: str = "Led scaling mode"


class InovelliNonNeutralOutput(types.enum1):
"""Inovelli non neutral output selection."""

Low = 0x00
High = 0x01


@CONFIG_DIAGNOSTIC_MATCH(
channel_names=CHANNEL_INOVELLI,
)
class InovelliNonNeutralOutputEntity(
ZCLEnumSelectEntity, id_suffix="increased_non_neutral_output"
):
"""Inovelli non neutral output control."""

_select_attr = "increased_non_neutral_output"
_enum = InovelliNonNeutralOutput
_attr_name: str = "Non neutral output"


class AqaraFeedingMode(types.enum8):
"""Feeding mode."""

Expand Down
44 changes: 34 additions & 10 deletions homeassistant/components/zha/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,25 +367,49 @@ class InovelliSmartBulbMode(ZHASwitchConfigurationEntity, id_suffix="smart_bulb_
@CONFIG_DIAGNOSTIC_MATCH(
channel_names=CHANNEL_INOVELLI,
)
class InovelliDoubleTapForFullBrightness(
ZHASwitchConfigurationEntity, id_suffix="double_tap_up_for_max_brightness"
class InovelliDoubleTapUpEnabled(
ZHASwitchConfigurationEntity, id_suffix="double_tap_up_enabled"
):
"""Inovelli double tap for full brightness control."""
"""Inovelli double tap up enabled."""

_zcl_attribute: str = "double_tap_up_for_max_brightness"
_attr_name: str = "Double tap full brightness"
_zcl_attribute: str = "double_tap_up_enabled"
_attr_name: str = "Double tap up enabled"


@CONFIG_DIAGNOSTIC_MATCH(
channel_names=CHANNEL_INOVELLI,
)
class InovelliDoubleTapForMinBrightness(
ZHASwitchConfigurationEntity, id_suffix="double_tap_down_for_min_brightness"
class InovelliDoubleTapDownEnabled(
ZHASwitchConfigurationEntity, id_suffix="double_tap_down_enabled"
):
"""Inovelli double tap down for minimum brightness control."""
"""Inovelli double tap down enabled."""

_zcl_attribute: str = "double_tap_down_for_min_brightness"
_attr_name: str = "Double tap minimum brightness"
_zcl_attribute: str = "double_tap_down_enabled"
_attr_name: str = "Double tap down enabled"


@CONFIG_DIAGNOSTIC_MATCH(
channel_names=CHANNEL_INOVELLI,
)
class InovelliAuxSwitchScenes(
ZHASwitchConfigurationEntity, id_suffix="aux_switch_scenes"
):
"""Inovelli unique aux switch scenes."""

_zcl_attribute: str = "aux_switch_scenes"
_attr_name: str = "Aux switch scenes"


@CONFIG_DIAGNOSTIC_MATCH(
channel_names=CHANNEL_INOVELLI,
)
class InovelliBindingOffToOnSyncLevel(
ZHASwitchConfigurationEntity, id_suffix="binding_off_to_on_sync_level"
):
"""Inovelli send move to level with on/off to bound devices."""

_zcl_attribute: str = "binding_off_to_on_sync_level"
_attr_name: str = "Binding off to on sync level"


@CONFIG_DIAGNOSTIC_MATCH(
Expand Down