mirror of
https://github.com/elisspace/core.git
synced 2026-09-25 03:56:55 +00:00
* Initial "group members assume state" implementation for ZHA * Remove left-over debug flag (where polling was disabled) * Implement _send_member_assume_state_event() method and also use after turn_off * Only assume updated arguments from service call to group * Make code more readable and change checks slightly * Move "send member assume state" events to LightGroup on/off calls * Include new config option in tests * Check that member is available before updating to assumed state * Lower "update group from child delay" for debouncer to basically 0 when using assumed member state * Allow "child to group" updates regardless of config option This is not needed, as group members will not update their state, as long as they're transitioning. (If a group transitions, it also sets its members to transitioning mode) This fixes multiple issues. Previously, the state of a group was completely wrong when: - turn on group with 10 second transition - turn on members individually - turn off members individually - group state would not update correctly * Move "default update group from child delay" constant * Change to new constant name in test * Also update fan test to new constant name * Decrease "update group from child delay" to 10ms In my testing, 0.0 also works without any issues and correctly de-bounces child updates when using the "assume state option". This is just for avoiding multiple state changes when changing the group -> children issue individual updates. With 2 children in a group and delay 0, both child updates only cause one group re-calculation and state change. 0.01 (10ms) should be plenty for very slow systems to de-bounce the update (and in the worst case, it'll cause just another state change but nothing breaks) * Also implement "assuming state" for effect Not sure if anybody even uses this, but this one is a bit special because the effect is always deactivated if it's not provided in the light.turn_on call. * Move shortened delay for "assuming members" to a constant * Add basic test to verify that group members assume on/off state * Move _assume_group_state function declaration out of async_added_to_hass * Fix rare edge-case when rapidly toggling lights and light groups at the same time This prevents an issue where either the group transition would unset the transition flag or the single light would unset the group transition status midst-transition. Note: When a new individual transition is started, we want to unset the group flag, as we actually cancel that transition. * Check that effect list exists, add return type * Re-trigger CI due to timeout * Increase ASSUME_UPDATE_GROUP_FROM_CHILD_DELAY slightly The debouncer is used when updating group member states either by assuming them (in which case we want to barely have any delay), or between the time we get the results back from polling (where we want a slightly longer time). As it's not easily possible to distinguish if a group member was updated via assuming the state of the group or by the polling that follows, 50 ms seems to be a good middle point. * Add debug print for when updating group state * Fix issues with "off brightness" when switching between group/members This fixes a bunch of issues with "off brightness" and passes it down to the members correctly. For example, if a light group is turned off with a transition (so bulbs get their level set to 1), this will also set the "off brightness" of all individual bulbs to the last level that they were at. (It really fixes a lot of issues when using the "member assume group state" option. It's not really possible to fix them without that.) Furthermore, issues where polling was previously needed to get the correct state after "playing with transitions", should now get be resolved and get correct state when using the "members assume group state" option. Note: The only case which still can't be fixed is the following: If individual lights have off_with_transition set, but not the group, and the group is then turned on without a level, individual lights might fall back to brightness level 1 (<- at least now shows correctly in UI even before polling). Since all lights might need different brightness levels to be turned on, we can't use one group call. But making individual calls when turning on a ZHA group would cause a lot of traffic and thereby be counter-productive. In this case, light.turn_on should just be called with a level (or individual calls to the lights should be made). Another thing that was changed is to reset off_with_transition/off_brightness for a LightGroup when a member is turned on (even if the LightGroup wasn't turned on using its turn_on method). off_with_transition/off_brightness for individual bulbs is now also turned off when a light is detected to be on during polling. Lastly, the waiting for polled attributes could previously cause "invalid state" to be set (so mid-transition levels). This could happen when group and members are repeatedly toggled at similar times. These "invalid states" could cause wrong "off brightness" levels if transitions are also used. To fix this, we check after waiting for the polled attributes in async_get_state to see if a transition has started in the meanwhile. If so, the values can be discarded. A new poll will happen later and if using the "members assume group state" config option, the values should already be correct before the polling. * Enable "group members assume state" config option by default The config tests are also updated to expect the config option be enabled by default. For all tests, the config option is generally disabled though: There are only two group related tests. The one that tests this new feature overrides the config option to be enabled anyway. The other tests works in a similar way but also "sends" attribute reports, so we want to disable the feature for that test. (It would also run with it enabled (if the correct CHILD_UPDATE value is patched), but then it would test the same stuff as the other test, hence we're disabling the config option for that test.)
238 lines
11 KiB
JSON
238 lines
11 KiB
JSON
{
|
|
"config": {
|
|
"flow_title": "{name}",
|
|
"step": {
|
|
"choose_serial_port": {
|
|
"title": "Select a Serial Port",
|
|
"data": { "path": "Serial Device Path" },
|
|
"description": "Select the serial port for your Zigbee radio"
|
|
},
|
|
"confirm": {
|
|
"description": "Do you want to set up {name}?"
|
|
},
|
|
"confirm_hardware": {
|
|
"description": "Do you want to set up {name}?"
|
|
},
|
|
"manual_pick_radio_type": {
|
|
"data": { "radio_type": "Radio Type" },
|
|
"title": "Radio Type",
|
|
"description": "Pick your Zigbee radio type"
|
|
},
|
|
"manual_port_config": {
|
|
"title": "Serial Port Settings",
|
|
"description": "Enter the serial port settings",
|
|
"data": {
|
|
"path": "Serial device path",
|
|
"baudrate": "port speed",
|
|
"flow_control": "data flow control"
|
|
}
|
|
},
|
|
"choose_formation_strategy": {
|
|
"title": "Network Formation",
|
|
"description": "Choose the network settings for your radio.",
|
|
"menu_options": {
|
|
"form_new_network": "Erase network settings and form a new network",
|
|
"reuse_settings": "Keep radio network settings",
|
|
"choose_automatic_backup": "Restore an automatic backup",
|
|
"upload_manual_backup": "Upload a manual backup"
|
|
}
|
|
},
|
|
"choose_automatic_backup": {
|
|
"title": "Restore Automatic Backup",
|
|
"description": "Restore your network settings from an automatic backup",
|
|
"data": {
|
|
"choose_automatic_backup": "Choose an automatic backup"
|
|
}
|
|
},
|
|
"upload_manual_backup": {
|
|
"title": "Upload a Manual Backup",
|
|
"description": "Restore your network settings from an uploaded backup JSON file. You can download one from a different ZHA installation from **Network Settings**, or use a Zigbee2MQTT `coordinator_backup.json` file.",
|
|
"data": {
|
|
"uploaded_backup_file": "Upload a file"
|
|
}
|
|
},
|
|
"maybe_confirm_ezsp_restore": {
|
|
"title": "Overwrite Radio IEEE Address",
|
|
"description": "Your backup has a different IEEE address than your radio. For your network to function properly, the IEEE address of your radio should also be changed.\n\nThis is a permanent operation.",
|
|
"data": {
|
|
"overwrite_coordinator_ieee": "Permanently replace the radio IEEE address"
|
|
}
|
|
}
|
|
},
|
|
"error": {
|
|
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
|
"invalid_backup_json": "Invalid backup JSON"
|
|
},
|
|
"abort": {
|
|
"single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]",
|
|
"not_zha_device": "This device is not a zha device",
|
|
"usb_probe_failed": "Failed to probe the usb device"
|
|
}
|
|
},
|
|
"options": {
|
|
"flow_title": "[%key:component::zha::config::flow_title%]",
|
|
"step": {
|
|
"init": {
|
|
"title": "Reconfigure ZHA",
|
|
"description": "ZHA will be stopped. Do you wish to continue?"
|
|
},
|
|
"prompt_migrate_or_reconfigure": {
|
|
"title": "Migrate or re-configure",
|
|
"description": "Are you migrating to a new radio or re-configuring the current radio?",
|
|
"menu_options": {
|
|
"intent_migrate": "Migrate to a new radio",
|
|
"intent_reconfigure": "Re-configure the current radio"
|
|
}
|
|
},
|
|
"intent_migrate": {
|
|
"title": "Migrate to a new radio",
|
|
"description": "Your old radio will be factory reset. If you are using a combined Z-Wave and Zigbee adapter like the HUSBZB-1, this will only reset the Zigbee portion.\n\nDo you wish to continue?"
|
|
},
|
|
"instruct_unplug": {
|
|
"title": "Unplug your old radio",
|
|
"description": "Your old radio has been reset. If the hardware is no longer needed, you can now unplug it."
|
|
},
|
|
"choose_serial_port": {
|
|
"title": "[%key:component::zha::config::step::choose_serial_port::title%]",
|
|
"data": {
|
|
"path": "[%key:component::zha::config::step::choose_serial_port::data::path%]"
|
|
},
|
|
"description": "[%key:component::zha::config::step::choose_serial_port::description%]"
|
|
},
|
|
"manual_pick_radio_type": {
|
|
"data": {
|
|
"radio_type": "[%key:component::zha::config::step::manual_pick_radio_type::data::radio_type%]"
|
|
},
|
|
"title": "[%key:component::zha::config::step::manual_pick_radio_type::title%]",
|
|
"description": "[%key:component::zha::config::step::manual_pick_radio_type::description%]"
|
|
},
|
|
"manual_port_config": {
|
|
"title": "[%key:component::zha::config::step::manual_port_config::title%]",
|
|
"description": "[%key:component::zha::config::step::manual_port_config::description%]",
|
|
"data": {
|
|
"path": "[%key:component::zha::config::step::manual_port_config::data::path%]",
|
|
"baudrate": "[%key:component::zha::config::step::manual_port_config::data::baudrate%]",
|
|
"flow_control": "[%key:component::zha::config::step::manual_port_config::data::flow_control%]"
|
|
}
|
|
},
|
|
"choose_formation_strategy": {
|
|
"title": "[%key:component::zha::config::step::choose_formation_strategy::title%]",
|
|
"description": "[%key:component::zha::config::step::choose_formation_strategy::description%]",
|
|
"menu_options": {
|
|
"form_new_network": "[%key:component::zha::config::step::choose_formation_strategy::menu_options::form_new_network%]",
|
|
"reuse_settings": "[%key:component::zha::config::step::choose_formation_strategy::menu_options::reuse_settings%]",
|
|
"choose_automatic_backup": "[%key:component::zha::config::step::choose_formation_strategy::menu_options::choose_automatic_backup%]",
|
|
"upload_manual_backup": "[%key:component::zha::config::step::choose_formation_strategy::menu_options::upload_manual_backup%]"
|
|
}
|
|
},
|
|
"choose_automatic_backup": {
|
|
"title": "[%key:component::zha::config::step::choose_automatic_backup::title%]",
|
|
"description": "[%key:component::zha::config::step::choose_automatic_backup::description%]",
|
|
"data": {
|
|
"choose_automatic_backup": "[%key:component::zha::config::step::choose_automatic_backup::data::choose_automatic_backup%]"
|
|
}
|
|
},
|
|
"upload_manual_backup": {
|
|
"title": "[%key:component::zha::config::step::upload_manual_backup::title%]",
|
|
"description": "[%key:component::zha::config::step::upload_manual_backup::description%]",
|
|
"data": {
|
|
"uploaded_backup_file": "[%key:component::zha::config::step::upload_manual_backup::data::uploaded_backup_file%]"
|
|
}
|
|
},
|
|
"maybe_confirm_ezsp_restore": {
|
|
"title": "[%key:component::zha::config::step::maybe_confirm_ezsp_restore::title%]",
|
|
"description": "[%key:component::zha::config::step::maybe_confirm_ezsp_restore::description%]",
|
|
"data": {
|
|
"overwrite_coordinator_ieee": "[%key:component::zha::config::step::maybe_confirm_ezsp_restore::data::overwrite_coordinator_ieee%]"
|
|
}
|
|
}
|
|
},
|
|
"error": {
|
|
"cannot_connect": "[%key:component::zha::config::error::cannot_connect%]",
|
|
"invalid_backup_json": "[%key:component::zha::config::error::invalid_backup_json%]"
|
|
},
|
|
"abort": {
|
|
"single_instance_allowed": "[%key:component::zha::config::abort::single_instance_allowed%]",
|
|
"not_zha_device": "[%key:component::zha::config::abort::not_zha_device%]",
|
|
"usb_probe_failed": "[%key:component::zha::config::abort::usb_probe_failed%]"
|
|
}
|
|
},
|
|
"config_panel": {
|
|
"zha_options": {
|
|
"title": "Global Options",
|
|
"enhanced_light_transition": "Enable enhanced light color/temperature transition from an off-state",
|
|
"light_transitioning_flag": "Enable enhanced brightness slider during light transition",
|
|
"always_prefer_xy_color_mode": "Always prefer XY color mode",
|
|
"group_members_assume_state": "Group members assume state of group",
|
|
"enable_identify_on_join": "Enable identify effect when devices join the network",
|
|
"default_light_transition": "Default light transition time (seconds)",
|
|
"consider_unavailable_mains": "Consider mains powered devices unavailable after (seconds)",
|
|
"consider_unavailable_battery": "Consider battery powered devices unavailable after (seconds)"
|
|
},
|
|
"zha_alarm_options": {
|
|
"title": "Alarm Control Panel Options",
|
|
"alarm_master_code": "Master code for the alarm control panel(s)",
|
|
"alarm_failed_tries": "The number of consecutive failed code entries to trigger an alarm",
|
|
"alarm_arm_requires_code": "Code required for arming actions"
|
|
}
|
|
},
|
|
"device_automation": {
|
|
"action_type": {
|
|
"squawk": "Squawk",
|
|
"warn": "Warn",
|
|
"issue_all_led_effect": "Issue effect for all LEDs",
|
|
"issue_individual_led_effect": "Issue effect for individual LED"
|
|
},
|
|
"trigger_type": {
|
|
"remote_button_short_press": "\"{subtype}\" button pressed",
|
|
"remote_button_short_release": "\"{subtype}\" button released",
|
|
"remote_button_long_press": "\"{subtype}\" button continuously pressed",
|
|
"remote_button_long_release": "\"{subtype}\" button released after long press",
|
|
"remote_button_double_press": "\"{subtype}\" button double clicked",
|
|
"remote_button_triple_press": "\"{subtype}\" button triple clicked",
|
|
"remote_button_quadruple_press": "\"{subtype}\" button quadruple clicked",
|
|
"remote_button_quintuple_press": "\"{subtype}\" button quintuple clicked",
|
|
"remote_button_alt_short_press": "\"{subtype}\" button pressed (Alternate mode)",
|
|
"remote_button_alt_short_release": "\"{subtype}\" button released (Alternate mode)",
|
|
"remote_button_alt_long_press": "\"{subtype}\" button continuously pressed (Alternate mode)",
|
|
"remote_button_alt_long_release": "\"{subtype}\" button released after long press (Alternate mode)",
|
|
"remote_button_alt_double_press": "\"{subtype}\" button double clicked (Alternate mode)",
|
|
"remote_button_alt_triple_press": "\"{subtype}\" button triple clicked (Alternate mode)",
|
|
"remote_button_alt_quadruple_press": "\"{subtype}\" button quadruple clicked (Alternate mode)",
|
|
"remote_button_alt_quintuple_press": "\"{subtype}\" button quintuple clicked (Alternate mode)",
|
|
"device_rotated": "Device rotated \"{subtype}\"",
|
|
"device_shaken": "Device shaken",
|
|
"device_slid": "Device slid \"{subtype}\"",
|
|
"device_tilted": "Device tilted",
|
|
"device_knocked": "Device knocked \"{subtype}\"",
|
|
"device_dropped": "Device dropped",
|
|
"device_flipped": "Device flipped \"{subtype}\"",
|
|
"device_offline": "Device offline"
|
|
},
|
|
"trigger_subtype": {
|
|
"turn_on": "Turn on",
|
|
"turn_off": "Turn off",
|
|
"dim_up": "Dim up",
|
|
"dim_down": "Dim down",
|
|
"left": "Left",
|
|
"right": "Right",
|
|
"open": "Open",
|
|
"close": "Close",
|
|
"both_buttons": "Both buttons",
|
|
"button_1": "First button",
|
|
"button_2": "Second button",
|
|
"button_3": "Third button",
|
|
"button_4": "Fourth button",
|
|
"button_5": "Fifth button",
|
|
"button_6": "Sixth button",
|
|
"face_any": "With any/specified face(s) activated",
|
|
"face_1": "with face 1 activated",
|
|
"face_2": "with face 2 activated",
|
|
"face_3": "with face 3 activated",
|
|
"face_4": "with face 4 activated",
|
|
"face_5": "with face 5 activated",
|
|
"face_6": "with face 6 activated"
|
|
}
|
|
}
|
|
}
|