Commit Graph

81726 Commits (4e94ce0cc7f76cb3c0eec2c68819b199878127fb)

Author SHA1 Message Date
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
Raman Gupta 7c6e3fe9c4
Fix `zwave_js` `services.yaml` schema (#124455)
Fix zwave_Js services.yaml schema
2024-08-23 08:38:08 +02:00
J. Nick Koston 7579ebc02a
Replace statistics _get_unit_class function with a dict lookup (#124452) 2024-08-22 21:14:31 -05:00
J. Nick Koston 61ac4c7af7
Use identity checks for ESPHome Enums (#124334)
Enums are singletons and should use is to compare.

The valve platform was updated but cover and lock were missed.
2024-08-22 22:50:15 +03:00
J. Nick Koston 2533bde27a
Bump yalexs to 8.1.4 (#124425)
changelog: https://github.com/bdraco/yalexs/compare/v8.1.2...v8.1.4
2024-08-22 22:46:54 +03:00
Raman Gupta fc1ed7d7cb
Refactor targets for zwave_js services (#115734)
* Let labels be used as targets for zwave_js services

* add coverage

* Fix test bug and switch from targets to fields

* Remove label addition

* Remove labels from service descriptions

* Remove labels from strings

* More changes
2024-08-22 21:07:21 +02:00
Joost Lekkerkerker 281a9f042b
Check minimum amount of integrations for a brand (#124310) 2024-08-22 21:01:48 +02:00
J. Nick Koston 1d35c745bb
Reduce ESPHome entity state write overhead (#124329) 2024-08-22 21:00:30 +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
Sid 6e5e96b047
Bump ruff to 0.6.2 (#124433) 2024-08-22 20:51:57 +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
Penny Wood 4a6f833fca
Add supported features for iZone (#124416)
* Fix for #123462

* Set outside of constructor
2024-08-22 15:39:09 +02:00
Jakob Schlyter c541cb5cba
Automatically generate Amazon Polly list of voices and regions (#119198)
* Automatically generate list of voices and regions. Requires AWS credentials.

* add missing commit

* replace pydantic with dataclass

* dictionary values are strings or list of strings

* also generated set of supported engines

* use sets for amazon polly parameters

* move default for readability
2024-08-22 15:36:11 +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 1bc0ec201a
Drop ignore-missing-annotations from pylint tests (#120302) 2024-08-22 15:13:00 +02:00
epenet 403db6277f
Improve type hints in lcn tests (#124415) 2024-08-22 14:50:45 +02:00
epenet 4e3bd55c73
Revert UnitOfReactivePower change from iotawatt (#124393)
Revert "Change POWER_VOLT_AMPERE_REACTIVE to UnitOfReactivePower (#117153)"

This reverts commit 3e53cc175f.
2024-08-22 12:11:07 +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
TimL 480e748b04
Bump pysmlight to 0.0.13 (#124398)
Better handle socket uptime disconnected
Raise auth error on get/post requests that fail
2024-08-22 12:04:03 +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
spongebobberts 9b9e98a26e
Fix typo in Alexa resources docstring (#124388)
Fixed typo in Alexa resources docstring
2024-08-22 09:05:13 +02:00
dependabot[bot] 60f9fbf800
Bump home-assistant/builder from 2024.08.1 to 2024.08.2 (#124341) 2024-08-22 08:55:43 +02:00
dependabot[bot] 2ff326b563
Bump github/codeql-action from 3.26.2 to 3.26.4 (#124390) 2024-08-22 08:55:16 +02:00
G Johansson 266cd623a5
Bump python-holidays to 0.55 (#124314) 2024-08-22 07:59:21 +02:00
J. Nick Koston ad362b1d4c
Bump dbus-fast to 2.23.0 (#124384) 2024-08-22 07:48:25 +02:00
epenet 47beddc6c6
Improve config flow type hints (part 4) (#124348) 2024-08-21 22:43:42 +02:00
epenet 913e5404da
Improve config flow type hints (part 1) (#124343)
* Improve config flow type hints

* Revert sms
2024-08-21 22:42:58 +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
Angel Nunez Mencias e9798cd1b4
update ttn_client - fix crash with SenseCAP devices (#124370)
update ttn_client
2024-08-21 21:14:03 +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
Markus Jacobsen 88b95c1236
Remove unneeded check for Bang & Olufsen events and device update (#124363)
Remove unneeded check for device and HomeAssistant availability
2024-08-21 17:03:21 +02:00
J. Nick Koston e56c235424
Bump async-interrupt to 1.2.0 (#124360)
changelog: https://github.com/bdraco/async_interrupt/compare/v1.1.2...v1.2.0
2024-08-21 16:59:41 +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
Mr. Bubbles b21b300625
Disable Habitica deprecated entities by default (#123522)
Deprecated sensor task entites disable by default
2024-08-21 14:59:08 +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