Commit graph

17614 commits

Author SHA1 Message Date
Jan Bouwhuis
a66ad39c4e
Assign color_mode for mqtt light as ColorMode () 2023-09-22 12:09:37 +02:00
Jan Bouwhuis
384adb1c87
Avoid redundant calls to async_write_ha_state in MQTT climate & water_heater ()
Limit state writes for mqtt climate & water_heater
2023-09-22 11:22:57 +02:00
Jan Bouwhuis
1041610a70
Avoid redundant calls to async_write_ha_state in MQTT mqtt alarm_control_panel ()
Limit state writes for mqtt alarm_control_panel
2023-09-22 11:22:09 +02:00
J. Nick Koston
1dadfcd52c
Avoid polling in sun sensor entities () 2023-09-22 11:16:37 +02:00
Bouwe Westerdijk
5cf5f5b4cf
Add missing step-differentiation for the Plugwise temperature_offset () 2023-09-21 19:31:53 +02:00
Erik Montnemery
ab060b86d1
Remove async_process_integration_platform_for_component () 2023-09-21 17:06:41 +02:00
Luke Lashley
e2bfa9f9cd
Add last clean sensors to Roborock ()
* Add water shortage binary sensor

* add last clean sensors

* fix tests

* fix tests again

* remove accidentally added binary sensor
2023-09-21 16:00:15 +02:00
Luke Lashley
6e0ab35f85
Add water shortage binary sensor () 2023-09-21 15:43:17 +02:00
Pedro Januário
c170babba6
Add ecoforest integration ()
* Add ecoforest integration

* fix file title

* remove host default from schema, hints will be given in the documentation

* moved input validation to async_step_user

* ensure we can receive device data while doing entry setup

* remove unecessary check before unique id is set

* added shorter syntax for async create entry

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* use variable to set unique id

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Use _attr_has_entity_name from base entity

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* remove unecessary comments in coordinator

* use shorthand for device information

* remove empty objects from manifest

* remove unecessary flag

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* use _async_abort_entries_match to ensure device is not duplicated

* remove unecessary host attr

* fixed coordinator host attr to be used by entities to identify device

* remove unecessary assert

* use default device class temperature trasnlation key

* reuse base entity description

* use device serial number as identifier

* remove unused code

* Improve logging message

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Remove unused errors

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Raise a generic update failed

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* use coordinator directly

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* No need to check for serial number

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* rename variable

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* use renamed variable

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* improve assertion

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* use serial number in entity unique id

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* raise config entry not ready on setup when error in connection

* improve test readability

* Improve python syntax

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* abort when device already configured with same serial number

* improve tests

* fix test name

* use coordinator data

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* improve asserts

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* fix ci

* improve error handling

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-09-21 15:18:55 +02:00
Jan Bouwhuis
aed3ba3acd
Avoid redundant calls to async_ha_write_state in MQTT (binary) sensor ()
* Only call `async_ha_write_state` on changes.

* Make helper class

* Use UndefinedType

* Remove del

* Integrate monitor into MqttEntity

* Track extra state attributes and availability

* Add `__slots__`

* Add monitor to MqttAttributes and MqttAvailability

* Write out loop

* Add test

* Make common test and parameterize

* Add test for last_reset attribute

* MqttMonitorEntity base class

* Rename attr and update docstr `track` method.

* correction doct

* Implement as a decorator

* Move tracking functions into decorator

* Rename decorator

* Follow up comment
2023-09-21 13:33:26 +02:00
Fletcher
11c4c37cf9
Add Slack thread/reply support () 2023-09-21 11:06:55 +02:00
Jan-Philipp Benecke
715d8dcb98
Add test to london underground ()
Co-authored-by: Robert Resch <robert@resch.dev>
2023-09-21 10:44:32 +02:00
J. Nick Koston
59daceafd2
Avoid calling extract_stack in system_log since it does blocking I/O () 2023-09-21 09:48:41 +02:00
J. Nick Koston
a03ad87cfb
Avoid ConfigEntry lookups in hass.config_entries.async_entries for domain index () 2023-09-20 18:43:15 +02:00
J. Nick Koston
ec5675ff4b
Fix hkid matching in homekit_controller when zeroconf value is not upper case () 2023-09-20 17:37:13 +02:00
Luke Lashley
77001b26de
Add second test device for Roborock () 2023-09-20 17:17:32 +02:00
J. Nick Koston
6f8734167f
Bump SQLAlchemy to 2.0.21 () 2023-09-20 16:19:53 +02:00
Abílio Costa
bd9bab000e
Add integration for IKEA Idasen Desk ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-09-20 02:44:35 +02:00
elmurato
f1a70189ac
Clean-up Minecraft Server tests ()
Remove patching of getmac, fix typo
2023-09-19 22:14:21 +02:00
J. Nick Koston
0eca433004
Update zeroconf discovery to use IPAddress objects to avoid conversions () 2023-09-19 18:58:46 +02:00
Ian
c3f74ae022
Add config-flow to NextBus () 2023-09-19 17:10:29 +02:00
Marc Mueller
37288d7788
Add pylint plugin to check for calls to base implementation () 2023-09-18 13:39:36 -05:00
rappenze
ddd62a8f63
Fibaro streamline hass.data entry ()
* Fibaro streamline hass.data entry

* Fix tests
2023-09-18 20:22:23 +02:00
Ville Skyttä
902f997ee0
Fix google invalid token expiry test init for UTC offsets > 0 ()
```
$ python3 -q
>>> import datetime, time
>>> time.tzname
('EET', 'EEST')
>>> datetime.datetime.max.timestamp()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: year 10000 is out of range
```
2023-09-18 12:39:43 +03:00
Marc Mueller
f41e3a2beb
Remove duplicate mobile_app client fixture () 2023-09-18 10:52:43 +02:00
Maciej Bieniek
f6243a1f79
Add event platform for Shelly gen2 devices ()
* Add event platform for gen2 devices

* Add tests

* Add removal condition

* Simplify RpcEventDescription; fix availability

* Improve names and docstrings

* Improve the event entity name

* Use async_on_remove()

* Improve tests coverage

* Improve tests coverage

* Prefix the entity name with the device name in the old way

* Black

* Use DeviceInfo object
2023-09-18 00:38:08 +02:00
jan iversen
9931f45532
Deprecate modbus parameter retry_on_empty () 2023-09-16 21:14:52 +02:00
Ravaka Razafimanantsoa
f99dedfb42
Add switchbot cloud integration ()
* Switches via API

* Using external library

* UT and checlist

* Updating file .coveragerc

* Update homeassistant/components/switchbot_via_api/switch.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/switchbot_via_api/switch.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/switchbot_via_api/switch.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Review fixes

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* This base class shouldn't know about Remote

* Fixing suggestion

* Sometimes, the state from the API is not updated immediately

* Review changes

* Some review changes

* Review changes

* Review change: Adding type on commands

* Parameterizing some tests

* Review changes

* Updating .coveragerc

* Fixing error handling in coordinator

* Review changes

* Review changes

* Adding switchbot brand

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* Review changes

* Adding strict typing

* Removing log in constructor

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-09-16 16:00:41 +02:00
jan iversen
568974fcc4
Modbus 100% test coverage (again) () 2023-09-16 14:00:22 +02:00
Jan-Philipp Benecke
57337b5cee
Move flipr coordinator to its own file () 2023-09-16 11:19:49 +02:00
Jan-Philipp Benecke
024db6dadf
Move cert_expiry coordinator to its own file ()
* Move cert_expiry coordinator to its own file

* Add missing patched config flow test
2023-09-16 11:19:05 +02:00
jan iversen
d25f45a957
Harden modbus against lib errors () 2023-09-16 09:57:55 +02:00
jan iversen
fd83f7d87f
Add test for modbus CONF_DEVICE_ADDR () 2023-09-15 16:12:44 +02:00
jan iversen
9eb0b844bc
Test VIRTUAL_COUNT parameter () 2023-09-15 15:02:24 +02:00
Joost Lekkerkerker
1737b27dd4
Generate withings webhook ID in config flow () 2023-09-15 12:58:56 +02:00
Erik Montnemery
d1afcd773f
Revert "Cache entity properties that are never expected to change in the base class" ()
Revert "Cache entity properties that are never expected to change in the base class ()"

This reverts commit 042776ebb8.
2023-09-15 11:25:24 +02:00
J. Nick Koston
042776ebb8
Cache entity properties that are never expected to change in the base class () 2023-09-14 17:48:48 -05:00
jan iversen
d4a2927ebe
Solve racing problem in modbus test ()
* Test racing problem.

* review comment.

* Revert to approved state.

This reverts commit 983d9d68e8.
2023-09-14 16:03:32 +02:00
Joost Lekkerkerker
6fc1407613
Extract Withings API specifics in own class ()
* Extract Withings API specifics in own class

* Extract Withings API specifics in own class

* Ignore api test coverage

* fix feedback
2023-09-14 13:31:54 +02:00
Ståle Storø Hauknes
b858658516
Fix Airthings ble migration ()
* Import Platform for tests

* Migration bugfix

* Store new unique id as a variable in tests

* Add comments to tests
2023-09-14 12:51:06 +02:00
Marty Sun
6692a37f0d
Add missing __init__.py file in yardian test folder () 2023-09-14 09:04:12 +02:00
mkmer
c265d3f3cc
Late review for honeywell ()
* Late review for honeywell

* Actually test same id different domain

* Update homeassistant/components/honeywell/climate.py

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

* Update climate.py

* Refactor dont_remove

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-09-14 06:22:28 +02:00
J. Nick Koston
547f32818c
Make core States use cached_property ()
Need to validate this is worth removing __slots__
2023-09-13 20:33:25 -04:00
J. Nick Koston
fe5eba9b31
Use cached_property in device registry () 2023-09-13 15:36:07 -05:00
Jan-Philipp Benecke
7b204ca36b
Use snapshot assertion for nexia diagnostics test () 2023-09-13 15:00:29 -05:00
J. Nick Koston
877eedf6d7
Use cached_property in entity_registry () 2023-09-13 14:38:40 -05:00
Quentame
8625bf7894
Add some tests to Freebox () 2023-09-13 20:22:47 +02:00
Robert Svensson
7b00265cfe
Remove legacy UniFi PoE client clean up () 2023-09-13 20:14:03 +02:00
Jan Rieger
ee65aa91e8
Allow setting the elevation in set_location ()
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-09-13 18:09:12 +02:00
Joost Lekkerkerker
f6b094dfee
Add options flow to Withings () 2023-09-13 18:08:15 +02:00