Commit graph

2530 commits

Author SHA1 Message Date
Marc Mueller 3937cc2963
Improve SERVICE_TO_METHOD typing (#120474) 2024-06-26 02:20:48 +02:00
Matthew FitzGerald-Chamberlain 034b5e88e0
Add Aprilaire air cleaning and fresh air functionality (#120174)
* Add custom services for Aprilaire

* Add icons.json

* Use select/number entities instead of services

* Remove unneeded consts

* Remove number platform

* Code review updates

* Update homeassistant/components/aprilaire/strings.json

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

* Code review updates

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-06-23 19:47:09 +02:00
Lenn 93e87997be
Add sensors to Motionblinds BLE integration (#114226)
* Add sensors

* Add sensor.py to .coveragerc

* Move icons to icons.json

* Remove signal strength translation key

* Change native_value attribute name in entity description to initial_value

* Use str instead of enum for MotionConnectionType for options

* Add calibration options to entity description

* Fix icons

* Change translations of connection and calibration

* Move entity descriptions to __init__

* Use generic sensor class

* Use generic sensor class

* Update homeassistant/components/motionblinds_ble/strings.json

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

* Update homeassistant/components/motionblinds_ble/sensor.py

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

* Update homeassistant/components/motionblinds_ble/strings.json

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

* Update homeassistant/components/motionblinds_ble/strings.json

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

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-06-22 13:25:03 +02:00
Matthew FitzGerald-Chamberlain ea8d0ba2ce
Add sensors for Aprilaire integration (#113194)
* Add sensors for Aprilaire integration

* Exclude from coverage

* Exclude from coverage

* Add comment

* Update homeassistant/components/aprilaire/sensor.py

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

* Code review updates

* Code review updates

* Code review updates

* Code review updates

* Remove temperature conversion

* Add suggested display precision

* Code review updates

* Merge fix

* Code review fixes

* Fix type errors

* Revert change

* Fix type errors

* Type errors

* Use common keys

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-06-22 13:20:33 +02:00
Robert Contreras 842763bd27
Add Home Connect binary_sensor unit tests (#115323) 2024-06-21 17:37:22 +02:00
dontinelli af9f4f310b
Add additional tests for solarlog (#119928) 2024-06-21 12:44:25 +02:00
Joost Lekkerkerker d21908a0e4
Add event entity to Nanoleaf (#120013)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-06-21 11:16:00 +02:00
Markus Jacobsen 1962759953
Add Bang olufsen init testing (#119834) 2024-06-21 07:35:38 +01:00
ashionky 3224224bf8
Add Sensor for Refoss Integration (#116965)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-20 10:29:37 +02:00
G Johansson e6967298ec
Remove circuit integration (#119921) 2024-06-19 23:14:43 +02:00
J. Nick Koston c686eda305
Reduce duplicate code in baf for entities with descriptions (#119945)
* Reduce duplicate code in baf for entities with descriptions

* Reduce duplicate code in baf for entities with descriptions

* no cover

* no cover
2024-06-18 21:39:32 -04:00
Joost Lekkerkerker edb391a0bd
Extract coordinator to separate module in Nanoleaf (#119896)
* Extract coordinator to separate module in Nanoleaf

* Extract coordinator to separate module in Nanoleaf

* Extract coordinator to separate module in Nanoleaf
2024-06-18 19:50:07 +02:00
Marlon 496338fa4e
Add number input for apsystems (#118825)
* Add number input for apsystems

* Exclude number from apsystems from coverage

* Remove unnecessary int-float conversion in apsystems number

* Remove unnecessary int-float conversion in apsystems number and redundant and single use variables

* Add translation for apsystems number
2024-06-17 10:31:21 +02:00
Mr. Bubbles 7bbd28d385
Migrate library to PyLoadAPI 1.1.0 in pyLoad integration (#116053)
* Migrate pyLoad integration to externa API library

* Add const to .coveragerc

* raise update failed when cookie expired

* fix exceptions

* Add tests

* bump to PyLoadAPI 1.1.0

* remove unreachable code

* fix tests

* Improve logging and exception handling

- Modify manifest.json to update logger configuration.
- Improve error messages for authentication failures in sensor.py.
- Simplify and rename pytest fixtures in conftest.py.
- Update test cases in test_sensor.py to check for log entries and remove unnecessary code.

* remove exception translations
2024-06-13 22:52:19 +02:00
J. Nick Koston ed0568c655
Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04:00
Jan Bouwhuis 956623d964
Fix device name not set on all incomfort platforms (#118827)
* Prelimenary tests for incomfort integration

* Use snapshot_platform

* Use helper

* Ensure the device name is set in device info

* Move snapshot tests to platform test modules

* Move unused snapshot file

* Naming and docstr

* update snapshots

* cleanup snapshots

* Add water heater tests
2024-06-04 20:51:34 +02:00
Richard Kroegel 1eb13b48a2
Add tests for BMW binary_sensor and lock (#118436)
* BMW: Add tests for binary_sensor & lock

* Use entity_registry_enabled_by_default fixture

* Update tests/components/bmw_connected_drive/test_binary_sensor.py

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

* Move fixtures to decorator

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

* Use fixture decorators if possible

* Fix rebase

* Spelling adjustments

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

* Use snapshot_platform helper

* Spelling

* Remove comment

---------

Co-authored-by: Richard <rikroe@users.noreply.github.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-06-04 15:08:15 +02:00
Mr. Bubbles 7815840194
Add ista EcoTrend integration (#118360)
* Add ista EcoTrend integration

* move code out of try

* Use account owners name as entry title

* update config flow tests

* add tests for init

* Add reauth flow

* Add tests for sensors

* add translations for reauth

* trigger statistics import on first refresh

* Move statistics and reauth flow to other PR

* Fix tests

* some changes

* draft_final_final

* remove unnecessary icons

* changed tests

* move device_registry test to init

* add text selectors
2024-06-04 10:45:53 +02:00
Joost Lekkerkerker 16fd19f01a
Use model from Aladdin Connect lib (#118778)
* Use model from Aladdin Connect lib

* Fix
2024-06-04 10:29:51 +02:00
Jan Bouwhuis dd1dd4c6a3
Migrate Intergas InComfort/Intouch Lan2RF gateway YAML to config flow (#118642)
* Add config flow

* Make sure the device is polled - refactor

* Fix

* Add tests config flow

* Update test requirements

* Ensure dispatcher has a unique signal per heater

* Followup on review

* Follow up comments

* One more docstr

* Make specific try blocks and refactoring

* Handle import exceptions

* Restore removed lines

* Move initial heater update in try block

* Raise issue failed import

* Update test codeowners

* Remove entity device info

* Remove entity device info

* Appy suggestions from code review

* Remove broad exception handling from entry setup

* Test coverage
2024-06-03 20:37:48 +02:00
Marlon c23ec96174
Add BaseEntity for apsystems integration (#117514)
* Add BaseEntity for apsystems integration

* Exclude entity.py from apsystems from coverage

* Remove api from BaseEntity from apsystems as it is not yet used

* Split BaseEntity and BaseCoordinatorEntity in apsystems integration

* Clean up of asserting unique_id everywhere in apsystems integration

* Remove BaseCoordinatorEntity from apsystems

* Remove double type declaration originating from merge in apsystems
2024-06-03 07:28:13 +02:00
osohotwateriot cf3e758aa1
Move OSO Energy base entity class to separate module (#118563)
Move base entity class to separate file
2024-05-31 16:13:20 +02:00
Diogo Gomes 822273a6a3
Add support for V2C Trydan 2.1.7 (#117147)
* Support for firmware 2.1.7

* add device ID as unique_id

* add device ID as unique_id

* add test device id as unique_id

* backward compatibility

* move outside try

* Sensor return type

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

* not needed

* make slave error enum state

* fix enum

* Update homeassistant/components/v2c/sensor.py

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

* Update homeassistant/components/v2c/strings.json

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

* Update homeassistant/components/v2c/strings.json

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

* simplify tests

* fix misspellings from upstream library

* add sensor tests

* just enough coverage for enum sensor

* Refactor V2C tests (#117264)

* Refactor V2C tests

* fix rebase issues

* ruff

* review

* fix https://github.com/home-assistant/core/issues/117296

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-30 20:42:48 +02:00
Maciej Bieniek cf51179009
Add tests for Tractive integration (#118470)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-30 12:45:11 +02:00
swcloudgenie a670169325
New official genie garage integration (#117020)
* new official genie garage integration

* move api constants into api module

* move scan interval constant to cover.py
2024-05-29 16:13:28 -04:00
G Johansson 13ebc6fb0e
Add more tests to Yale Smart Alarm (#116501) 2024-05-29 10:34:20 +02:00
osohotwateriot 1c2cda5033
Add OSO Energy binary sensors (#117174) 2024-05-29 08:36:20 +02:00
Ludovic BOUÉ f44dfe8fef
Add Matter fan platform (#111212)
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
2024-05-28 12:24:58 +02:00
Erwin Douna fb95b91507
Add DSMR Reader tests (#115808)
* Add DSMR Reader sensor tests

* Change to paramatization

* Removing patch

* Emulate the test

* Go for 100% test coverage

* Adding defintions.py

* Add myself as code owner to keep improving
2024-05-28 10:42:21 +02:00
dontinelli 2a8fc7f310
Add Fyta sensor tests (#117995)
* Add test for init

* update tests

* split common.py into const.py and __init__.py

* Update tests/components/fyta/__init__.py

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

* add autospec, tidy up

* adjust len-test

* add test_sensor.py, amend tests for coordinator.py

* Update tests/components/fyta/conftest.py

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

* move load_unload with expired token into own test

* Update tests/components/fyta/test_init.py

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

* ruff change

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-27 12:01:11 +02:00
Angel Nunez Mencias b85cf36a68
Upgrade thethingsnetwork to v3 (#113375)
* thethingsnetwork upgrade to v3

* add en translations and requirements_all

* fix most of the findings

* hassfest

* use ttn_client v0.0.3

* reduce content of initial release

* remove features that trigger errors

* remove unneeded

* add initial testcases

* Exception warning

* add strict type checking

* add strict type checking

* full coverage

* rename to conftest

* review changes

* avoid using private attributes - use protected instead

* simplify config_flow

* remove unused options

* review changes

* upgrade client

* add types client library - no need to cast

* use add_suggested_values_to_schema

* add ruff fix

* review changes

* remove unneeded comment

* use typevar for TTN value

* use typevar for TTN value

* review

* ruff error not detected in local

* test review

* re-order fixture

* fix test

* reviews

* fix case

* split testcases

* review feedback

* Update homeassistant/components/thethingsnetwork/__init__.py

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

* Update homeassistant/components/thethingsnetwork/__init__.py

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

* Update tests/components/thethingsnetwork/test_config_flow.py

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

* Remove deprecated var

* Update tests/components/thethingsnetwork/test_config_flow.py

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

* Remove unused import

* fix ruff warning

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-26 16:30:33 +02:00
Christian Neumeier ee38099a91
Add tests to Zeversolar integration (#117928) 2024-05-24 22:18:29 +02:00
epenet 6a10e89f6d
Exclude gold and platinum integrations from .coveragerc (#117563) 2024-05-24 16:10:22 +02:00
epenet d4df86da06
Move TibberDataCoordinator to separate module (#118027) 2024-05-24 11:05:54 +02:00
epenet 95840a031a
Move nuki coordinator to separate module (#117975) 2024-05-24 10:55:26 +02:00
epenet 39f618d5e5
Add snapshot tests to nuki (#117973) 2024-05-24 10:36:59 +02:00
Evgeny 24d31924a0
Migrate OpenWeaterMap to new library (support API 3.0) (#116870)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-23 21:51:10 -10:00
epenet 8da799e420
Move omnilogic coordinator to separate module (#118014) 2024-05-24 08:48:05 +02:00
epenet 4ee1460eec
Move moehlenhoff_alpha2 coordinator to separate module (#117970) 2024-05-23 21:06:00 +02:00
epenet 6b2ddcca5e
Move rainmachine coordinator to separate module (#117983)
* Move rainmachine coordinator to separate module

* Coverage
2024-05-23 16:41:50 +02:00
epenet bc51a4c524
Add snapshot tests to moehlenhoff_alpha2 (#117967)
* Add tests to moehlenhoff_alpha2

* Adjust coverage

* Adjust coverage

* Adjust coverage

* Adjust patch

* Adjust
2024-05-23 11:54:20 +02:00
dontinelli 6682244abf
Improve fyta tests (#117661)
* Add test for init

* update tests

* split common.py into const.py and __init__.py

* Update tests/components/fyta/__init__.py

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

* add autospec, tidy up

* adjust len-test

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-23 10:51:30 +02:00
Michael 6d3cafb43b
Move entity definitions into own module in AVM Fritz!Tools (#117701)
* move entity definitions into own module

* merge entity description mixin

* add entity.py to .coveragerc
2024-05-18 22:25:25 +02:00
epenet 4dad9c8859
Move plenticore coordinators to separate module (#117491) 2024-05-18 13:11:22 +02:00
epenet a904557bbb
Move philips_js coordinator to separate module (#117561) 2024-05-18 10:21:22 +02:00
Christopher Tremblay b015dbfccb
Add AlarmDecoder device info (#117357)
* Update AlarmDecoder component to newer model

This commit makes AlarmDecoder operate as a proper device entity following the new model introduced a few years ago.

Code also has an internal dependency on a newer version of adext (>= 0.4.3) which has been updated correspondingly.

* Created AlarmDecoder entity

Added an alarmdecoder entity so the device_info can be re-used across the integration

* Move _attr_has_entity_name to base entity

As per code review suggestion, clean up the object model.

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

* Missed one suggestion with the prior commit

Moves _attr_has_entity_name to base entity

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

* Address some ruff issues

* Apply additional ruff cleanups

Ran ruff again to clean up a few files tat weren't picked up last time

* Apply suggestions from code review

Some additional cleanup of style & removal of unnecessary code

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

* Properly generated the integration file

generation had to happen twice for this to work.  Now that it's generated, I'm including the missing update.

* Apply suggestions from code review

Use local client variable instead of self._client

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

* Sort the manifest

documentation was added, but it wasn't sorted properly in the key/value pairs

* Add alarmdecoder entity file to coverage ignore file

Added the alarmdecoder entity file so it is ignored for coverage

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-05-18 08:59:44 +02:00
epenet a29a0a36e5
Move elmax coordinator to separate module (#117425) 2024-05-17 16:02:19 +02:00
epenet eacbebce22
Prevent const.py in coverage ignore list (#117625) 2024-05-17 12:53:58 +02:00
epenet 407d0f88f0
Rename openweathermap coordinator module (#117609) 2024-05-17 08:05:11 +02:00
Joost Lekkerkerker 68b7302cdc
Add Poolsense platform tests (#117579) 2024-05-16 21:35:00 +02:00