Commit Graph

23176 Commits (5dc03752ca44335c0a3e9b84698d712f7cb8feb2)

Author SHA1 Message Date
Markus Jacobsen 5dc03752ca
Add type hinting to Bang & Olufsen test (#124423) 2024-08-24 12:59:08 +02:00
Robert Svensson 9e13184256
Add deCONZ Air Purifier Fan Mode select entity support (#124513)
* Add deCONZ Air Purifier Fan Mode select entity support

* Remove unused constants
2024-08-24 09:51:09 +02:00
Steven B. e26d363b5e
Convert ring integration to the async ring-doorbell api (#124365)
* Bump ring-doorbell to 0.9.0

* Convert ring integration to async ring-doorbell api

* Use mock auth fixture class to get token_updater

* Fix typo in fixture name
2024-08-24 08:23:31 +02:00
Joost Lekkerkerker 7ae8f4c9d0
Don't abort airgradient user flow if flow in progress (#124300) 2024-08-24 07:20:00 +02:00
Christophe Gagnier 79ba315008
Add `charging enabled` switch to TechnoVE (#121484)
* Add session_active switch to TechnoVE

* Replace multi-line lambda with function def

* Make lambda one line
2024-08-23 22:45:26 +02:00
Jan Bouwhuis 26e87509be
Cleanup hassio fixtures in home assistant hardware integration tests (#124500) 2024-08-23 19:40:35 +02:00
J. Nick Koston af2fec89d8
Bump yalexs to 8.3.3 (#124492)
* Bump yalexs to 8.2.0

changelog: https://github.com/bdraco/yalexs/compare/v8.1.4...v8.2.0

* bump to 8.3.1

* bump

* one more bump to ensure we do not hit the ratelimit/shutdown cleanly

* empty commit to restart ci since close/open did not work in flight
2024-08-23 19:23:05 +02:00
Steven B. 61cee043e6
Do not report tplink discovery failures as legacy connection failures (#124432)
* Do not report discovery failures as legacy connection failures

* Fix catching BaseException
2024-08-23 10:17:48 -05:00
Jan Bouwhuis fd57931cc9
Cleanup redundant fixtures on matter integration for addon tests (#124445) 2024-08-23 16:27:14 +02:00
Jan Bouwhuis 44b6bca89a
Refactor and cleanup zwave_js fixtures to share them (#124485)
Refactor and cleanup zwave_js fixtures to use
2024-08-23 15:42:57 +02:00
starkillerOG 0bd9386df2
Reolink add 100% coverage of siren platform (#124474) 2024-08-23 15:15:04 +02:00
Ino Dekker 611723e44b
Bump aiohue to version 4.7.3 (#124436) 2024-08-23 13:43:17 +02:00
starkillerOG ab064a7f36
Reolink add 100% coverage of number platform (#124465)
* Add 100% number test coverage

* review comments

* fix styling

* re-add AsyncMock for chime
2024-08-23 12:34:58 +02:00
Willem-Jan van Rootselaar 4e94ce0cc7
Refactor bsblan coordinator (#124308)
* chore: Refactor BSBLanUpdateCoordinator to improve code readability and maintainability

* feat: Add BSBLan integration models

This commit adds the models for the BSB-Lan integration. It includes a dataclass for the BSBLanCoordinatorData, which stores the state and sensor information.

* refactor: Update BSBLANClimate class to use DataUpdateCoordinator without specifying the State type

* chore: Remove unused Sensor import in BSBLan models

* feat: Refactor BSBLanEntity to use CoordinatorEntity

The BSBLanEntity class has been refactored to inherit from the CoordinatorEntity class, which provides better integration with the update coordinator. This change improves code readability and maintainability.

* refactor: Remove unused config_entry variable in BSBLanUpdateCoordinator

* refactor: Update BSBLANClimate class to use DataUpdateCoordinator

Refactor the BSBLANClimate class to use the Coordinator of the entity

* refactor: Update tests to use the new structure

* fix coverage

 it should be the same as before

* refactor: moved dataclass BSBLanCoordinatorData

* use the data class inside init

* refactor: Remove unused config_entry variable in BSBLanUpdateCoordinator

* refactor: use BSBLanData from init

* remove entry data from diagnostics

* fix: add random interval back

* refactor: Simplify coordinator_data assignment in async_get_config_entry_diagnostics

* revert back to original except dataclass import

* revert: Add MAC address back to device info in BSBLanEntity
2024-08-23 08:42:36 +02:00
Jan Bouwhuis 51dba1eec3
Cleanup redundant fixtures and move all other hassio addon fixtures to be shared (#124437) 2024-08-22 20:58:05 +02:00
Jan Bouwhuis e13f8996f2
Fix Import ReceivePayloadType (#124431)
* Fix Import ReceivePayloadType

* Do not assert export `ReceivePayloadType` on mqtt integration level as helper should be used.
2024-08-22 20:13:30 +02:00
Jan Bouwhuis 7887bcba89
Allow to set options for an MQTT enum sensor (#123248)
* Add options attribute support for MQTT sensor

* Add comment
2024-08-22 19:16:08 +02:00
Michael Arthur 3a92899081
Add LawnMowerActivity.RETURNING to Lawn Mower (#124261)
* Add returning activity state

* update tests

* update tests

* set can return to returning state

* update MQTT tests

* update mqtt back to docked

* fix up other tests that I broke again

* re-add mower_can_dock
2024-08-22 19:13:54 +02:00
Petro31 5d64155bb6
Add zip to template engine (#122460)
* add zip to template engine

* fix doc strings
2024-08-22 19:11:08 +02:00
J. Nick Koston 6f66f37fc7
Shutdown database engine before waiting for executor shutdown (#117339)
* Close database connection before stopping the executor

related issue #117004

* Close database connection before waiting for database executor to finish

related issue #117004

* fix test

* fix

* drop unused arg

* Revert "drop unused arg"

This reverts commit 8a9fe6a24a.

* docstring

* comment
2024-08-22 16:47:22 +02:00
Markus Jacobsen 890c6e97fd
Add Bang & Olufsen websocket testing (#123075)
* Add websocket.py testing
Convert media_player testing dispatch events to the proper websocket events

* Fix WebSocket testing by using callbacks

* Add typing

* Add caplog checking
Check dispatch events directly
Check event bus directly
Avoid using internals

* Fix event and / dispatch callbacks not necessarily being checked

* Remove unnecessary caplog log level handling
2024-08-22 16:31:15 +02:00
Erik Montnemery 404a7bab18
Wrap OSError in loader.load_yaml (#124406) 2024-08-22 09:06:41 -05:00
Markus Jacobsen 2337c3ff69
Improve Bang olufsen test typing and parameter order (#124419)
* Add proper media_player typing to tests

* Add proper typing to init tests

* Add proper typing to config_flow tests

* Fix order of parameters of tests

* Add more typing
Reorder parameters
2024-08-22 15:49:42 +02:00
J. Nick Koston df82567356
Fix shelly available check when device is not initialized (#124182)
* Fix shelly available check when device is not initialized

available needs to check for device.initialized or if the device
is sleepy as calls to status will raise NotInitialized which results
in many unretrieved exceptions while writing state

fixes
```
2024-08-18 09:33:03.757 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/config/custom_components/shelly/entity.py", line 374, in _update_callback
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 293, in state
    if (is_on := self.is_on) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/shelly/binary_sensor.py", line 331, in is_on
    return bool(self.attribute_value)
                ^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/shelly/entity.py", line 545, in attribute_value
    self._last_value = self.sub_status
                       ^^^^^^^^^^^^^^^
  File "/config/custom_components/shelly/entity.py", line 534, in sub_status
    return self.status[self.entity_description.sub_key]
           ^^^^^^^^^^^
  File "/config/custom_components/shelly/entity.py", line 364, in status
    return cast(dict, self.coordinator.device.status[self.key])
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 390, in status
    raise NotInitialized
aioshelly.exceptions.NotInitialized
```

* tweak

* cover

* fix

* cover

* fixes
2024-08-22 16:14:45 +03:00
epenet 403db6277f
Improve type hints in lcn tests (#124415) 2024-08-22 14:50:45 +02:00
Erik Montnemery ab6d0e3277
Handle !include without arguments in configuration.yaml (#124399)
* Prevent !include without arguments in configuration.yaml from crashing core

* Add test
2024-08-22 12:08:24 +02:00
Jan Bouwhuis b541d214ed
Fix lingering mqtt unload entry test (#124392) 2024-08-22 11:03:35 +02:00
G Johansson 0c8ed18ca5
Use setup_test_component_platform in Climate tests (#123941)
* Use setup_test_component_platform in Climate tests

* Rename mock integration helper

* Change name to register_test_integration

* Change name in tests

* Fix ruff format
2024-08-22 09:38:27 +02:00
Jan Bouwhuis 61114d8328
Install and start Mosquitto MQTT broker add on from MQTT config flow (#124106)
* Opt in to install Mosquitto broker add-on in MQTT config flow

* rephrase

* Tests with supervisor and running add-on

* Complete tests for success flows

* Also set up entry in success flow

* Use realistic names for addon and broker

* Finetuning and fail test cases

* Spelling

* Improve translation strings

* Update addon docstr

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

* Raise AddonError if add-on does not start

* Only show the option to use the add-on

* Simplify flow, rework and cleanup

* Revert unrelated cleanup, process suggestion

* Move ADDON_SLUG const to addon module

* Move fixture to component level

* Move back supervisor fixture

* Move addon_setup_time_fixture and superfixe to config flow model tests

* Refactor hassio fixture

* Rename helpers as they are no fixtures, remove fixture from their names

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-08-22 09:07:45 +02:00
Mr. Bubbles 67bc568db6
Add tests for Bring integration (#123087)
* Add tests to bring integration

* use more parametrization

* json fixture loading, move notification tests
2024-08-21 22:18:33 +02:00
Patrick Frazer 5f53d3f917
Add DROP Alert product support (#117867)
* Add DROP Alert product support

* Add DROP Alert to sensor selftest

* Fix Alert sensor naming ambiguity

* Reorder a constant

* Alphabetize strings

* Remove unnecessary translation key
2024-08-21 21:56:59 +02:00
Anrijs 4ef55e5088
Add Aranet Radon Plus support (#124197)
added aranet radon plus support
2024-08-21 22:12:20 +03:00
Pete Sage 9399a54c7a
Fix Spotify Media Browsing fails for new config entries (#124368)
* initial commit

* tests

* tests

* update tests

* update tests

* update tests
2024-08-21 21:05:09 +02:00
Markus Jacobsen d86b816491
Convert Bang & Olufsen testing logging patches to caplog (#124366)
* Convert logging patches to caplog

* Remove unnecessary caplog log level handling
2024-08-21 17:11:01 +02:00
mvn23 ec256166cc
Rename OpenThermGatewayDevice to OpenThermGatewayHub (#124361)
* Rename OpenThermGatewayDevice to OpenThermGatewayHub
Update references accordingly

* Update tests
2024-08-21 16:56:57 +02:00
Jeef 9de90ca7d5
Fix Weatherflow Cloud lightning (#124082)
* Adding a error condition and a fix for missing lightning epoch values

* adding parentheses around the lambda

* Updating PR

* removed the dumb test

* Updated tests to support good stuff

* Updated snapshots
2024-08-21 16:16:16 +02:00
Christian Neumeier 3e53cc175f
Change POWER_VOLT_AMPERE_REACTIVE to UnitOfReactivePower (#117153)
* Refactoring: exchange POWER_VOLT_AMPERE_REACTIVE with UnitOfReactivePower

* updated iotawatt and mysensors from VOLT_AMPERE_REACTIVE to UnitOfReactivePower.VOLT_AMPERE_REACTIVE

* deprecation period for POWER_VOLT_AMPERE_REACTIVE changed to one year.

* POWER_VOLT_AMPERE_REACTIVE changed to UnitOfReactivePower in blebox integration

* Update homeassistant/const.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-08-21 15:36:45 +02:00
Christopher Fenner 52c0a09107
Add test cases for ViCare entities (#122983)
* add test case

* add test case

* add test case

* add test case

* add test case

* add test case

* remove commented code

* test only fan platform

* add test case

* remove fan mock
2024-08-21 14:42:58 +02:00
Mr. Bubbles 8d97fafb2d
Add tests for IronOS integration (#123078)
Add tests
2024-08-21 14:03:40 +02:00
Michał Jaworski 316a57864a
Extend blebox shutterbox tilt support (#110547)
* blebox: extend shutterbox tilt support

* feat: add test for new open/close tilt code in blebox covers

* blebox: resign from using future compat branch for cover open/close tilt

* Update homeassistant/components/blebox/cover.py

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

* blebox: revert changes to BLEBOX_TO_HASS_COVER_STATES

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-08-21 12:53:40 +02:00
Andre Lengwenus c276cfc371
Add custom panel for LCN configuration (#108664)
* Add LCN panel using lcn-frontend module

* Move panel from sidebar to integration configuration

* Change OptionFlow to reconfigure step

* Change OptionFlow to reconfigure step

* Remove deprecation warning

* Fix docstring

* Add tests for lcn websockets

* Remove deepcopy

* Bump lcn-frontend to 0.1.3

* Add tests for lcn websockets

* Remove websocket command lcn/hosts

* Websocket scan tests cover modules not stored in config_entry

* Add comment to mock of hass.http

* Add a decorater to ensure the config_entry exists and return it

* Use entry_id instead of host_id

* Bump lcn-frontend to 0.1.5

* Use auto_id for websocket client send_json

* Create issues on yaml import errors

* Remove low level key deprecation warnings

* Method renaming

* Change issue id in issue creation

* Update tests for issue creation
2024-08-21 11:33:47 +02:00
Pete Sage d327ec904c
Add Sonos tests for media_player play Sonos Playlist and improve error handling (#124126)
* initial commit

* initial commit

* initial commit

* updates

* add json fixture

* use match on pytest.raises
2024-08-20 18:38:04 +02:00
Jan Bouwhuis b74aced6f3
Subscribe per component for MQTT discovery (#119974)
* Subscribe per component for MQTT discovery

* Use single assignment

* Handle wildcard subscriptions first

* Split subsRecription handling, update helper

* Fix help_all_subscribe_calls

* Fix import

* Fix test

* Update import order

* Undo move self._last_subscribe

* Recover removed test

* Revert not needed changes to binary_sensor platform tests

* Revert line removal

* Rework interation of discovery topics

* Reduce

* Add comment

* Move comment

* Chain subscriptions
2024-08-20 17:02:48 +02:00
Erik Montnemery a1e3e7f24f
Deduplicate OTBR test fixtures (#124293) 2024-08-20 14:58:34 +02:00
Erik Montnemery 15976b8207
Disable expensive pskc computation in all otbr tests (#124292)
* Disable expensive pskc computation in all otbr tests

* Update tests and fixtures which patched compute_pskc
2024-08-20 14:53:06 +02:00
epenet 3dc83ef19d
Add missing hass type hint in component tests (t) (#124274) 2024-08-20 12:55:39 +02:00
epenet 14775c822f
Add missing hass type hint in component tests (y) (#124286) 2024-08-20 12:55:14 +02:00
epenet 69a5605551
Add missing hass type hint in component tests (x) (#124285) 2024-08-20 12:54:57 +02:00
epenet c2dc4ef215
Add missing hass type hint in component tests (w) (#124284) 2024-08-20 12:54:42 +02:00
epenet e6eedc0717
Add missing hass type hint in component tests (v) (#124281) 2024-08-20 12:54:15 +02:00