Fix ZHA VZM35-SN attributes (#102924)
* Fixes for VZM35-SN Attributes * Fixes * Update strings.json Was missing translation keys from strings.json * Minor Tweak to switch_type entity Editing main switch_type entity to ensure it doesn't cause an error for the VZM35-SN * Fix for Button Delay Entitypull/104150/head
parent
e755dd83b6
commit
483e0c9a85
|
@ -224,7 +224,12 @@ class InovelliConfigEntityClusterHandler(ClusterHandler):
|
||||||
"""Inovelli Configuration Entity cluster handler."""
|
"""Inovelli Configuration Entity cluster handler."""
|
||||||
|
|
||||||
REPORT_CONFIG = ()
|
REPORT_CONFIG = ()
|
||||||
ZCL_INIT_ATTRS = {
|
|
||||||
|
def __init__(self, cluster: zigpy.zcl.Cluster, endpoint: Endpoint) -> None:
|
||||||
|
"""Initialize Inovelli cluster handler."""
|
||||||
|
super().__init__(cluster, endpoint)
|
||||||
|
if self.cluster.endpoint.model == "VZM31-SN":
|
||||||
|
self.ZCL_INIT_ATTRS = {
|
||||||
"dimming_speed_up_remote": True,
|
"dimming_speed_up_remote": True,
|
||||||
"dimming_speed_up_local": True,
|
"dimming_speed_up_local": True,
|
||||||
"ramp_rate_off_to_on_local": True,
|
"ramp_rate_off_to_on_local": True,
|
||||||
|
@ -267,6 +272,46 @@ class InovelliConfigEntityClusterHandler(ClusterHandler):
|
||||||
"relay_click_in_on_off_mode": True,
|
"relay_click_in_on_off_mode": True,
|
||||||
"disable_clear_notifications_double_tap": True,
|
"disable_clear_notifications_double_tap": True,
|
||||||
}
|
}
|
||||||
|
elif self.cluster.endpoint.model == "VZM35-SN":
|
||||||
|
self.ZCL_INIT_ATTRS = {
|
||||||
|
"dimming_speed_up_remote": True,
|
||||||
|
"dimming_speed_up_local": True,
|
||||||
|
"ramp_rate_off_to_on_local": True,
|
||||||
|
"ramp_rate_off_to_on_remote": True,
|
||||||
|
"dimming_speed_down_remote": True,
|
||||||
|
"dimming_speed_down_local": True,
|
||||||
|
"ramp_rate_on_to_off_local": True,
|
||||||
|
"ramp_rate_on_to_off_remote": True,
|
||||||
|
"minimum_level": True,
|
||||||
|
"maximum_level": True,
|
||||||
|
"invert_switch": True,
|
||||||
|
"auto_off_timer": True,
|
||||||
|
"default_level_local": True,
|
||||||
|
"default_level_remote": True,
|
||||||
|
"state_after_power_restored": True,
|
||||||
|
"load_level_indicator_timeout": True,
|
||||||
|
"power_type": False,
|
||||||
|
"switch_type": False,
|
||||||
|
"non_neutral_aux_med_gear_learn_value": True,
|
||||||
|
"non_neutral_aux_low_gear_learn_value": True,
|
||||||
|
"quick_start_time": False,
|
||||||
|
"button_delay": False,
|
||||||
|
"smart_fan_mode": False,
|
||||||
|
"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,
|
||||||
|
"aux_switch_scenes": True,
|
||||||
|
"local_protection": False,
|
||||||
|
"output_mode": False,
|
||||||
|
"on_off_led_mode": True,
|
||||||
|
"firmware_progress_led": True,
|
||||||
|
"smart_fan_led_display_levels": True,
|
||||||
|
}
|
||||||
|
|
||||||
async def issue_all_led_effect(
|
async def issue_all_led_effect(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -629,7 +629,7 @@ class InovelliRemoteDimmingUpSpeed(ZHANumberConfigurationEntity):
|
||||||
class InovelliButtonDelay(ZHANumberConfigurationEntity):
|
class InovelliButtonDelay(ZHANumberConfigurationEntity):
|
||||||
"""Inovelli button delay configuration entity."""
|
"""Inovelli button delay configuration entity."""
|
||||||
|
|
||||||
_unique_id_suffix = "dimming_speed_up_local"
|
_unique_id_suffix = "button_delay"
|
||||||
_attr_entity_category = EntityCategory.CONFIG
|
_attr_entity_category = EntityCategory.CONFIG
|
||||||
_attr_icon: str = ICONS[3]
|
_attr_icon: str = ICONS[3]
|
||||||
_attr_native_min_value: float = 0
|
_attr_native_min_value: float = 0
|
||||||
|
@ -778,6 +778,22 @@ class InovelliAutoShutoffTimer(ZHANumberConfigurationEntity):
|
||||||
_attr_translation_key: str = "auto_off_timer"
|
_attr_translation_key: str = "auto_off_timer"
|
||||||
|
|
||||||
|
|
||||||
|
@CONFIG_DIAGNOSTIC_MATCH(
|
||||||
|
cluster_handler_names=CLUSTER_HANDLER_INOVELLI, models={"VZM35-SN"}
|
||||||
|
)
|
||||||
|
# pylint: disable-next=hass-invalid-inheritance # needs fixing
|
||||||
|
class InovelliQuickStartTime(ZHANumberConfigurationEntity):
|
||||||
|
"""Inovelli fan quick start time configuration entity."""
|
||||||
|
|
||||||
|
_unique_id_suffix = "quick_start_time"
|
||||||
|
_attr_entity_category = EntityCategory.CONFIG
|
||||||
|
_attr_icon: str = ICONS[3]
|
||||||
|
_attr_native_min_value: float = 0
|
||||||
|
_attr_native_max_value: float = 10
|
||||||
|
_attribute_name = "quick_start_time"
|
||||||
|
_attr_translation_key: str = "quick_start_time"
|
||||||
|
|
||||||
|
|
||||||
@CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI)
|
@CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI)
|
||||||
# pylint: disable-next=hass-invalid-inheritance # needs fixing
|
# pylint: disable-next=hass-invalid-inheritance # needs fixing
|
||||||
class InovelliLoadLevelIndicatorTimeout(ZHANumberConfigurationEntity):
|
class InovelliLoadLevelIndicatorTimeout(ZHANumberConfigurationEntity):
|
||||||
|
|
|
@ -447,7 +447,7 @@ class InovelliOutputModeEntity(ZCLEnumSelectEntity):
|
||||||
|
|
||||||
|
|
||||||
class InovelliSwitchType(types.enum8):
|
class InovelliSwitchType(types.enum8):
|
||||||
"""Inovelli output mode."""
|
"""Inovelli switch mode."""
|
||||||
|
|
||||||
Single_Pole = 0x00
|
Single_Pole = 0x00
|
||||||
Three_Way_Dumb = 0x01
|
Three_Way_Dumb = 0x01
|
||||||
|
@ -456,7 +456,7 @@ class InovelliSwitchType(types.enum8):
|
||||||
|
|
||||||
|
|
||||||
@CONFIG_DIAGNOSTIC_MATCH(
|
@CONFIG_DIAGNOSTIC_MATCH(
|
||||||
cluster_handler_names=CLUSTER_HANDLER_INOVELLI,
|
cluster_handler_names=CLUSTER_HANDLER_INOVELLI, models={"VZM31-SN"}
|
||||||
)
|
)
|
||||||
class InovelliSwitchTypeEntity(ZCLEnumSelectEntity):
|
class InovelliSwitchTypeEntity(ZCLEnumSelectEntity):
|
||||||
"""Inovelli switch type control."""
|
"""Inovelli switch type control."""
|
||||||
|
@ -467,6 +467,25 @@ class InovelliSwitchTypeEntity(ZCLEnumSelectEntity):
|
||||||
_attr_translation_key: str = "switch_type"
|
_attr_translation_key: str = "switch_type"
|
||||||
|
|
||||||
|
|
||||||
|
class InovelliFanSwitchType(types.enum1):
|
||||||
|
"""Inovelli fan switch mode."""
|
||||||
|
|
||||||
|
Load_Only = 0x00
|
||||||
|
Three_Way_AUX = 0x01
|
||||||
|
|
||||||
|
|
||||||
|
@CONFIG_DIAGNOSTIC_MATCH(
|
||||||
|
cluster_handler_names=CLUSTER_HANDLER_INOVELLI, models={"VZM35-SN"}
|
||||||
|
)
|
||||||
|
class InovelliFanSwitchTypeEntity(ZCLEnumSelectEntity):
|
||||||
|
"""Inovelli fan switch type control."""
|
||||||
|
|
||||||
|
_unique_id_suffix = "switch_type"
|
||||||
|
_attribute_name = "switch_type"
|
||||||
|
_enum = InovelliFanSwitchType
|
||||||
|
_attr_translation_key: str = "switch_type"
|
||||||
|
|
||||||
|
|
||||||
class InovelliLedScalingMode(types.enum1):
|
class InovelliLedScalingMode(types.enum1):
|
||||||
"""Inovelli led mode."""
|
"""Inovelli led mode."""
|
||||||
|
|
||||||
|
@ -486,6 +505,34 @@ class InovelliLedScalingModeEntity(ZCLEnumSelectEntity):
|
||||||
_attr_translation_key: str = "led_scaling_mode"
|
_attr_translation_key: str = "led_scaling_mode"
|
||||||
|
|
||||||
|
|
||||||
|
class InovelliFanLedScalingMode(types.enum8):
|
||||||
|
"""Inovelli fan led mode."""
|
||||||
|
|
||||||
|
VZM31SN = 0x00
|
||||||
|
Grade_1 = 0x01
|
||||||
|
Grade_2 = 0x02
|
||||||
|
Grade_3 = 0x03
|
||||||
|
Grade_4 = 0x04
|
||||||
|
Grade_5 = 0x05
|
||||||
|
Grade_6 = 0x06
|
||||||
|
Grade_7 = 0x07
|
||||||
|
Grade_8 = 0x08
|
||||||
|
Grade_9 = 0x09
|
||||||
|
Adaptive = 0x0A
|
||||||
|
|
||||||
|
|
||||||
|
@CONFIG_DIAGNOSTIC_MATCH(
|
||||||
|
cluster_handler_names=CLUSTER_HANDLER_INOVELLI, models={"VZM35-SN"}
|
||||||
|
)
|
||||||
|
class InovelliFanLedScalingModeEntity(ZCLEnumSelectEntity):
|
||||||
|
"""Inovelli fan switch led mode control."""
|
||||||
|
|
||||||
|
_unique_id_suffix = "smart_fan_led_display_levels"
|
||||||
|
_attribute_name = "smart_fan_led_display_levels"
|
||||||
|
_enum = InovelliFanLedScalingMode
|
||||||
|
_attr_translation_key: str = "smart_fan_led_display_levels"
|
||||||
|
|
||||||
|
|
||||||
class InovelliNonNeutralOutput(types.enum1):
|
class InovelliNonNeutralOutput(types.enum1):
|
||||||
"""Inovelli non neutral output selection."""
|
"""Inovelli non neutral output selection."""
|
||||||
|
|
||||||
|
|
|
@ -721,6 +721,9 @@
|
||||||
},
|
},
|
||||||
"away_preset_temperature": {
|
"away_preset_temperature": {
|
||||||
"name": "Away preset temperature"
|
"name": "Away preset temperature"
|
||||||
|
},
|
||||||
|
"quick_start_time": {
|
||||||
|
"name": "Quick start time"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"select": {
|
"select": {
|
||||||
|
@ -766,6 +769,9 @@
|
||||||
"led_scaling_mode": {
|
"led_scaling_mode": {
|
||||||
"name": "Led scaling mode"
|
"name": "Led scaling mode"
|
||||||
},
|
},
|
||||||
|
"smart_fan_led_display_levels": {
|
||||||
|
"name": "Smart fan led display levels"
|
||||||
|
},
|
||||||
"increased_non_neutral_output": {
|
"increased_non_neutral_output": {
|
||||||
"name": "Non neutral output"
|
"name": "Non neutral output"
|
||||||
},
|
},
|
||||||
|
@ -878,6 +884,9 @@
|
||||||
"smart_bulb_mode": {
|
"smart_bulb_mode": {
|
||||||
"name": "Smart bulb mode"
|
"name": "Smart bulb mode"
|
||||||
},
|
},
|
||||||
|
"smart_fan_mode": {
|
||||||
|
"name": "Smart fan mode"
|
||||||
|
},
|
||||||
"double_tap_up_enabled": {
|
"double_tap_up_enabled": {
|
||||||
"name": "Double tap up enabled"
|
"name": "Double tap up enabled"
|
||||||
},
|
},
|
||||||
|
|
|
@ -364,6 +364,17 @@ class InovelliSmartBulbMode(ZHASwitchConfigurationEntity):
|
||||||
_attr_translation_key = "smart_bulb_mode"
|
_attr_translation_key = "smart_bulb_mode"
|
||||||
|
|
||||||
|
|
||||||
|
@CONFIG_DIAGNOSTIC_MATCH(
|
||||||
|
cluster_handler_names=CLUSTER_HANDLER_INOVELLI, models={"VZM35-SN"}
|
||||||
|
)
|
||||||
|
class InovelliSmartFanMode(ZHASwitchConfigurationEntity):
|
||||||
|
"""Inovelli smart fan mode control."""
|
||||||
|
|
||||||
|
_unique_id_suffix = "smart_fan_mode"
|
||||||
|
_attribute_name = "smart_fan_mode"
|
||||||
|
_attr_translation_key = "smart_fan_mode"
|
||||||
|
|
||||||
|
|
||||||
@CONFIG_DIAGNOSTIC_MATCH(
|
@CONFIG_DIAGNOSTIC_MATCH(
|
||||||
cluster_handler_names=CLUSTER_HANDLER_INOVELLI,
|
cluster_handler_names=CLUSTER_HANDLER_INOVELLI,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue