Commit Graph

13401 Commits (e43802eb0769fb8850f9533de873d94b260bc1e2)

Author SHA1 Message Date
Robert Svensson e43802eb07
Use more _attrs_* in Axis entities (#85555)
* Use _attr_available

* Use _attr_is_on

* Use _attr_name

* Make some values private

* Update names of axis entity base classes

* Fix review comments
2023-01-18 17:27:13 +01:00
Marcel van der Veldt 4bebf00598
Adjust device registry for Matter devices (#86108)
* adjust device registry

* ignore test unique id

* update test

* ditch uniqueid + prefix serial

* adjust test

* add tests

* fix switch test

* prefix all identifiers

* Update homeassistant/components/matter/adapter.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* no underscore in id

* fix test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-18 17:17:33 +01:00
mkmer 5e6ba594aa
Change Honeywell somecomfort API to AIOSomecomfort API (#86102)
* Move to AIOSomecomfort

* Remove unused constant

* Improve test coverage to 100

* Update homeassistant/components/honeywell/__init__.py

remove "todo" from code

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Missing cannot_connect translation

* add asyncio errors
update devices per entity
rework retry login

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-01-18 16:03:13 +01:00
Erik Montnemery fea5330cee
Change 'Sky Connect' to 'SkyConnect' (#86166) 2023-01-18 08:43:38 -05:00
Erik Montnemery f17a829bd8
Only wait for import flows to initialize at setup (#86106)
* Only wait for import flows to initialize at setup

* Update hassio tests

* Update hassio tests

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-18 10:44:18 +01:00
J. Nick Koston 5279535046
Fix live logbook stalling when there are no historical events with a high commit interval (#86110)
* Force live logbook to send an empty message to indicate no results

Since the sync task can take a while if the recorder is
busy, the logbook will appear to hang if we do not send
the first partial message even if its empty.

This work is in preparation for a higher database
commit interval where this issue is most obvious.

The historical only path did not have this issue because
it never had to wait for the db sync.

* update tests
2023-01-17 21:06:37 -05:00
Franck Nijhof 91aaca6471
Code styling tweaks to the Alexa integration (#86121) 2023-01-18 01:01:30 +02:00
Daniel Gangl cc74fcbda7
Remove deprecated zamg YAML config (#86113) 2023-01-17 21:58:20 +01:00
Erik Montnemery f6cd399b9e
Adjust kitchen_sink test (#86099) 2023-01-17 19:31:10 +01:00
Aaron Bach 27359dfc89
Subclass a `DataUpdateCoordinator` for Ridwell (#85644) 2023-01-17 19:31:00 +01:00
Erik Montnemery b4abfb1697
Adjust Thread config flow (#86097)
* Adjust Thread config flow

* Improve tests

* Update homeassistant/components/otbr/config_flow.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-17 13:27:33 -05:00
Erik Montnemery cf68d081ca
Allow manually setting up the Thread integration (#86087) 2023-01-17 12:50:29 -05:00
Jon Caruana 65c4e63e30
Bump pylitejet to 0.4.6 (now with async!) (#85493) 2023-01-17 16:53:16 +01:00
Erik Montnemery 096ef5da47
Use Home Assistant swing modes in tado climate (#84278) 2023-01-17 16:13:49 +01:00
Marcel van der Veldt 072517f17e
Fix Matter unique_id generation (#86046)
* bae entity unique id on Operational Instance Name standard

* Update homeassistant/components/matter/entity.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

* also adjust unique id for devices

* final adjustment

* remove assert on server_info

* move device info to init

* fabric_id_hex

* use DeviceInfo instead of dict

* fix test

Co-authored-by: Stefan Agner <stefan@agner.ch>
2023-01-17 15:39:42 +01:00
Erik Montnemery 3cd6bd87a7
Remove config entry specifics from FlowManager (#85565) 2023-01-17 15:26:17 +01:00
Duco Sebel 0f3221eac7
Add Enum device class for HomeWizard active tariff (#86078)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-01-17 14:46:08 +01:00
Erik Montnemery 11b9a0b383
Add Thread integration (#85002)
* Add Thread integration

* Add get/set operational dataset as TLVS

* Add create operational dataset

* Add set thread state

* Adjust after rebase

* Improve HTTP status handling

* Improve test coverage

* Change domains from thread to otbr

* Setup otbr from a config entry

* Add files

* Store URL in config entry data

* Make sure manifest is not sorted

* Remove useless async

* Call the JSON parser more

* Don't raise exceptions without messages

* Remove stuff which will be needed in the future

* Remove more future stuff

* Use API library

* Bump library to 1.0.1
2023-01-17 14:01:36 +01:00
Guido Schmitz cb36905ce5
Add diagnostics to devolo Home Network (#86022) 2023-01-17 12:59:02 +01:00
epenet 1918f21fb1
Raise HomeAssistantError in Renault (#86071) 2023-01-17 11:44:18 +01:00
Franck Nijhof 566c0f63bd
Removes OpenALPR Local integration (#85544) 2023-01-17 10:43:14 +01:00
epenet f7d69ee325
Remove deprecated Renault service (#86070) 2023-01-17 10:28:33 +01:00
Jack Boswell ec1b4d5651
Address Starlink code quality and add update sensor (#86066)
* Use dt.now

* Bring back update binary sensor

* Don't patch coordinator

* Add silver quality scale
2023-01-17 09:10:40 +01:00
Franck Nijhof 4aba3fdad6
Code styling tweaks to the zeroconf integration (#86048) 2023-01-16 18:35:23 -10:00
Brandon Rothweiler 2ed6df9003
Add EufyLife Bluetooth integration (#85907)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-16 18:29:50 -10:00
J. Nick Koston d949f51f10
Handle ignored shelly entries when discovering via zeroconf (#86039)
fixes https://github.com/home-assistant/core/issues/85879
2023-01-16 11:21:49 -10:00
Nathan Spencer c6f60bf45d
Code cleanup in litterrobot (#86037) 2023-01-16 20:58:30 +01:00
Michael d8c3b87d44
Replace deprecated constants and utils by their successors in NWS tests (#85926) 2023-01-16 20:02:26 +01:00
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
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
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
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
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
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
Michael a7ebec4d02
Make Synology DSM integration fully async (#85904) 2023-01-15 13:19:08 -10:00