Commit Graph

58080 Commits (65c4e63e301eac9330b4c43f2463ace278a9262a)

Author SHA1 Message Date
Marcel van der Veldt fe583b7c4a
Remove SSDP discovery from Hue (#85506)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-16 19:56:46 +01:00
Allen Porter 1afb4897a8
Add a timeout during OAuth token exchange and additional debug logging (#85911) 2023-01-16 19:52:43 +01:00
Franck Nijhof c5dedb7a79
Code styling tweaks to the recorder integration (#86030) 2023-01-16 19:51:11 +01:00
Shay Levy 5b2c1d701a
Bump aiowebostv to 0.3.2 (#86031)
fixes undefined
2023-01-16 19:51:00 +01:00
shbatm b229347625
Fix entity cleanup and naming bugs in ISY994 (#86023) 2023-01-16 19:43:42 +01:00
Franck Nijhof 6a89b3a135
Small refactor to HomeWizard config flow (#86020)
* Small refactor to HomeWizard config flow

* Update homeassistant/components/homewizard/config_flow.py

Co-authored-by: Duco Sebel <74970928+DCSBL@users.noreply.github.com>

* Process review comments

Co-authored-by: Duco Sebel <74970928+DCSBL@users.noreply.github.com>
2023-01-16 17:03:00 +01:00
epenet 9205020fa4
Avoid import homeassistant.const as a module (#85991) 2023-01-16 16:49:49 +01:00
TheJulianJES 9f0bed0f0c
Implement "group members assume state" option for ZHA (#84938)
* 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.)
2023-01-16 10:48:18 -05:00
Paul Bottein c3e27f6812
Add tier summation delivered for Lixee Zlinky TIC (#82602)
* Add tier summation delivered for zlinky

* Improve name case

* Add other tiers and register tier

* Fix smartenergy sensor update

* Account for new reporting configuration in unit tests

* Use cluster ID attributes instead of hardcoding the values

* Use tier names instead of the numeric constants for formatter

* Revert active register tier delivered

* Fix tests

Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
2023-01-16 10:33:18 -05:00
epenet 83591704b5
Adjust sensor validation warning (#86017) 2023-01-16 15:48:00 +01:00
jan iversen ee85a23d19
Bring modbus back to 100% test coverage (#85972)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-01-16 15:44:11 +01:00
epenet bcef0d66ac
Remove invalid uom from mqtt tests (#86004) 2023-01-16 14:51:35 +01:00
epenet 1a8933d59d
Adjust invalid test values in template (#86008) 2023-01-16 14:42:47 +01:00
epenet 0328e8954d
Adjust invalid test values in tcp (#86007) 2023-01-16 14:32:01 +01:00
Franck Nijhof 0a367359f4
Add sensor state class validation for device classes (#84402)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-01-16 14:31:24 +01:00
epenet 8165f487c7
Adjust invalid test values in snmp (#86006) 2023-01-16 14:00:37 +01:00
epenet c1589d3c89
Adjust invalid test values in rest (#86009) 2023-01-16 13:37:38 +01:00
epenet 6859a9ebdd
Add missing mock in fritzbox (#86005) 2023-01-16 13:05:22 +01:00
Jussi Rosenberg 54d570a9cf
Bump pykoplenti to 1.0.0 (#83251)
* Update Kostal integration to use maintained lib

* Update Kostal integration to use pykoplenti

* Update kostal_plenticore tests for new lib

* Fix tests config_flow & diagnostics after changes
2023-01-16 12:54:29 +01:00
Franck Nijhof c26d620ab1
Clean up unused import steps from HomeWizard config flow (#86002) 2023-01-16 12:24:23 +01:00
Shay Levy dd18708b63
Remove WebOS TV client wrapper (#86001) 2023-01-16 12:03:57 +01:00
Franck Nijhof 2b037efee2
Cleanup of HomeWizard button platform (#85999) 2023-01-16 11:57:08 +01:00
epenet 13cfd60019
Allow None in add_suggested_values_to_schema (#85763) 2023-01-16 11:36:21 +01:00
Franck Nijhof 11a81dc485
Improve typing of HomeWizard sensors (#85997)
* Improve typing of HomeWizard sensors

* Fix typo when tried to fix a typo :)
2023-01-16 11:22:46 +01:00
Erik Montnemery f9662e0af0
Make the kitchen_sink integration set up a config entry (#85680)
* Make the kitchen_sink integration set up a config entry

* Update homeassistant/components/kitchen_sink/config_flow.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Add singleton check in import step + add test

* Fix tests

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-01-16 11:03:44 +01:00
epenet 3179101fbc
Warn if numeric sensors have an invalid value (#85863)
Co-authored-by: mib1185 <mail@mib85.de>
2023-01-16 11:00:07 +01:00
Duco Sebel ccd8bc14e0
Add sensors for new P1 datapoints in HomeWizard (#85198)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
fixes undefined
2023-01-16 09:59:07 +01:00
Franck Nijhof ce43a53585
Update pytest to 7.2.1 (#85990) 2023-01-16 09:48:39 +01:00
Erik Montnemery affea9a305
Remove sky connect config entry if USB stick is not plugged in (#85765)
* Remove sky connect config entry if USB stick is not plugged in

* Tweak cleanup

* Give some stuff more cromulent names

* Do the needful

* Add tests

* Tweak
2023-01-16 09:25:06 +01:00
Franck Nijhof fa0d653216
Update python-homewizard-energy to 1.5.0 (#85966)
* Update python-homewizard-energy to 1.5.0

* Remove strict typing for now

* Revert "Remove strict typing for now"

This reverts commit ebcd327fdf.

* Adjust typing to resolve upstream changes
2023-01-16 09:23:03 +01:00
Jorie Teunissen 719f2e650c
Add state_class to mill Estimated CO2 sensor (#85894) 2023-01-16 09:02:15 +01:00
J. Nick Koston 233332c3a0
Fix fetching history include_start_time_state when timezone is not UTC (#85983) 2023-01-16 09:01:32 +01:00
Michael 9709391b52
Replace the usage of unit constants by enumerations in Tests [s-u] (#85937) 2023-01-16 09:00:27 +01:00
Patrick ZAJDA 0b02abf708
Add locking and unlocking to MQTT lock (#85779)
* Implement locking, unlocking and jammed on MQTT lock

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Add tests

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Refactor condition

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Parametrize tests

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Manage only locking and unlocking

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Remove jammed from abbreviations

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* set valid states in self._valid_states

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2023-01-16 08:42:43 +01:00
Jesse Hills d3c41bc31c
Add friendly name support for ESPHome (#85976)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-15 21:33:44 -10:00
Jack Boswell 8c235357a4
Add Starlink reboot button (#85729) 2023-01-15 21:22:19 -10:00
shbatm 176eb01016
Deprecate ISY994 custom cleanup entities service (#85931) 2023-01-15 21:14:41 -10:00
shbatm dfc33f858a
Support availability for ISY994 devices (#85928) 2023-01-15 19:18:51 -10:00
GitHub Action b81453cb6b [ci skip] Translation update 2023-01-16 00:24:22 +00:00
Michael a7ebec4d02
Make Synology DSM integration fully async (#85904) 2023-01-15 13:19:08 -10:00
J. Nick Koston 65ca62c991
Ensure remote bluetooth adapters are loaded before integrations that need them (#85723) 2023-01-15 13:17:17 -10:00
shbatm cd31624768
Bump PyISY to 3.1.6 (#85974)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-15 13:02:30 -10:00
jan iversen 05c1aff0f6
Bump pymodbus library to V3.1.0 (#85961)
fixes undefined
2023-01-15 23:30:26 +01:00
Franck Nijhof 64c2340fab
Core code styling improvements (#85963) 2023-01-15 23:00:51 +01:00
Duco Sebel 8e5236528f
Upgrade HomeWizard to platinum quality (#82580) 2023-01-15 23:00:20 +01:00
Jan Bouwhuis 01e1e254e2
Use value of enum (#85944) 2023-01-15 19:30:29 +01:00
Shay Levy 28804b7ecc
Update webOS TV codeowners (#85959) 2023-01-15 20:14:36 +02:00
Franck Nijhof 91ac6400b9
Clean up legacy import from HomeWizard (#85960) 2023-01-15 20:14:19 +02:00
Michael 9828b2d13f
Replace the usage of unit constants by enumerations in Tests [v-z] (#85938)
replace unit conts by enums v-z
2023-01-15 20:14:02 +02:00
Shay Levy 03d9d30eca
Cleanup webOS TV YAML import leftovers (#85957) 2023-01-15 20:07:15 +02:00