Update Inovelli Blue Series switch support in ZHA (#91254)

Co-authored-by: David F. Mulcahey <david.mulcahey@icloud.com>
pull/91305/head
codyhackw 2023-04-12 16:09:16 -04:00 committed by GitHub
parent fd7d0fff1f
commit 4f507e7f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 110 additions and 13 deletions

View File

@ -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,

View File

@ -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."""

View File

@ -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(
@ -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."""

View File

@ -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(