Compare commits

...

456 Commits

Author SHA1 Message Date
J. Nick Koston
87a00eb80f merge 2024-09-09 11:40:01 -05:00
J. Nick Koston
72efcf0e94 Merge branch 'dev' into lutron_caseta_event_rework 2024-09-09 11:37:24 -05:00
Robert Resch
0459596e97 Enable hadolint for hassfest docker image and adjust hadolint job (#125146) 2024-09-09 16:02:44 +02:00
epenet
6ea59ffa94 Add alias to DOMAIN import in tests [h-m] (#125577)
* Add alias to DOMAIN import in tests [h-m]

* Revert changes to mqtt
2024-09-09 15:21:01 +02:00
epenet
aab939cf6c Add alias to DOMAIN import in tests [a-d] (#125573) 2024-09-09 15:20:40 +02:00
epenet
fe2402b611 Add alias to DOMAIN import in tests [e-g] (#125575) 2024-09-09 15:18:28 +02:00
epenet
029dbe7d94 Add alias to DOMAIN import in homekit (#125572) 2024-09-09 15:14:35 +02:00
epenet
af6434a533 Add alias to DOMAIN import in tests [n-z] (#125581) 2024-09-09 15:14:05 +02:00
Erik Montnemery
dee4b33c64 Sort and remove duplicates from template/const.py (#125591) 2024-09-09 15:11:18 +02:00
Ludovic BOUÉ
8fff0075ba Add Matter BatVoltage attribute from PowerSource cluster (#125503)
* Add BatVoltage Attribute from PowerSource Cluster

* Update sensor.py

Remove comment

* Update homeassistant/components/matter/sensor.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-09-09 14:50:01 +02:00
Martin Hjelmare
d7caaceb64 Document plant integration development state (#125590) 2024-09-09 14:47:04 +02:00
Jan Bouwhuis
3889482f0e Do not directy import platform DOMAIN const in MQTT platform tests (#125589) 2024-09-09 14:36:15 +02:00
Michael Hansen
1dc496a2dd Add announce support to ESPHome Assist Satellite platform (#125157)
Rebuild
2024-09-09 08:25:25 -04:00
karwosts
056e6eae82 Add a syntax for merging lists of triggers (#117698)
* Add a syntax for merging lists of triggers

* Updating to the new syntax

* Update homeassistant/helpers/config_validation.py

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

* fix suggestion

* update test and add comments

* not actually json

* move test to new file

* update tests

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-09-09 13:51:32 +02:00
epenet
06e876aee0 Add alias to DOMAIN import in group (#125569) 2024-09-09 11:07:19 +02:00
Matthias Alphart
713689491b Remove KNX yaml config from hass.data (#124050)
* Remove KNX yaml config from `hass.data`

* Use HassKey
2024-09-09 09:01:21 +02:00
Chris Brouwer
17ab45da43 Fix support for Heat meters to DSMR integration (#125523)
* Fix support for Heat meters to DSMR integration

* Fixed test
2024-09-09 08:36:59 +02:00
Erik Montnemery
2a1df2063d Separate recorder test fixtures disabling context id migration (#125324)
* Separate recorder test fixtures disabling context id migration

* Fix test
2024-09-09 08:16:30 +02:00
Jesse Hills
d88487e30b Bump aioesphomeapi to 25.4.0 (#125554) 2024-09-08 22:54:18 -05:00
Michael Hansen
8884465262 ESPHome media proxy (#123254)
* Add ffmpeg proxy view

* Add tests

* Add proxy to media player

* Add proxy test

* Only allow one ffmpeg proc per device

* Incorporate feedback

* Fix tests

* address comments

* Fix test

* Update paths without auth const

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-09-08 22:22:35 -04:00
Denis Shulyaka
a85ccb94e3 LLM Tool parameters check (#123621)
* LLM Tool parameters check

* fix tests
2024-09-08 18:42:51 -07:00
J. Nick Koston
391de22342 Bump yarl to 1.11.0 (#125549)
changelog: https://github.com/aio-libs/yarl/compare/v1.10.0...v1.11.0
2024-09-08 20:25:10 -04:00
J. Nick Koston
0592a39164 Fix building multidict binary wheels on armv7 and armhf (#125550)
Fix building multidict wheels on armv7 and armhf

This is the same fix as we needed for yarl

The armv7 and armhf wheels are missing
for multidict 6.0.5

https://wheels.home-assistant.io/musllinux/
2024-09-08 20:24:57 -04:00
Álvaro Fernández Rojas
dca287748d Update aioairzone to v0.9.1 (#125547) 2024-09-08 17:56:29 -05:00
epenet
021878e942 Migrate ambient_network to use runtime_data (#125535) 2024-09-08 17:01:45 -05:00
epenet
0f2525d476 Migrate anova to use runtime_data (#125536) 2024-09-08 22:13:32 +02:00
epenet
4d804649fc Migrate apcupsd to use runtime_data (#125539) 2024-09-08 22:07:19 +02:00
epenet
7209b3c7d3 Migrate aosmith to use runtime_data (#125538) 2024-09-08 22:05:48 +02:00
epenet
6f88b6e64e Migrate anthemav to use runtime_data (#125537) 2024-09-08 22:04:34 +02:00
Jan-Philipp Benecke
4bcde36a97 Fix failing blebox climate tests (#125522) 2024-09-08 15:42:33 -04:00
epenet
7f4fc4d371 Migrate airvisual to use runtime_data (#125532)
* Migrate airvisual to use runtime_data

* Remove usedefault

* Adjust
2024-09-08 21:39:05 +02:00
Jason Hunter
513361ef0f Fix failing template config flow tests (#125534)
fix: failing template config flow tests
2024-09-08 21:38:31 +02:00
epenet
8ce236de80 Migrate amberelectric to use runtime_data (#125533) 2024-09-08 21:29:14 +02:00
epenet
8b8083a639 Migrate smappee to use runtime_data (#125529) 2024-09-08 21:18:08 +02:00
Steven B.
26ac8e35cb Add event platform to ring (#125506) 2024-09-08 13:32:34 -05:00
Jan-Philipp Benecke
20600123f8 Update bring todo entity snapshots (#125518)
Update bring todo snapshot
2024-09-08 18:52:21 +02:00
Steven B.
b3d6f8861f Fix ring notifications (#124879)
* Enable ring event listener to fix missing notifications

* Fix pylint test CI fail

* Reinstate binary sensor and add deprecation issues

* Add tests

* Update post review

* Remove PropertyMock

* Update post review

* Split out adding event platform
2024-09-08 18:17:30 +02:00
David Knowles
5405279273 Fix Schlage removed locks (#123627)
* Fix bugs when a lock is no longer returned by the API

* Changes requested during review

* Only mark unavailable if lock is not present

* Remove stale comment

* Remove over-judicious nullability checks

* Remove another unnecessary null check
2024-09-08 17:39:23 +02:00
Paulus Schoutsen
634582eab7 Ensure Linkplay model_id is always defined (#125488)
Linkplay: ensure model_id always defined
2024-09-08 11:36:36 -04:00
Pete Sage
2c48f9aa4c FIx Sonos announce regression issue (#125515)
* initial commit

* initial commit
2024-09-08 17:34:27 +02:00
Whitney Young
8d0dda6523 Remove notify support for templates (#122820) 2024-09-08 17:31:58 +02:00
Joost Lekkerkerker
6967c70580 Change Knocki integration type to hub (#124863)
* Change Knocki integration type

* Fix
2024-09-08 17:11:19 +02:00
Janusz Gregorczyk
7bab3579ec Set required attribute when using Todoist Sync API reminder_add command (#122644)
* Set type=absolute when using Todoist Sync API reminder_add command.

This argument is required:

ref.: https://developer.todoist.com/sync/v8/#add-a-reminder

* Fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-08 16:50:24 +02:00
Ian
aa8c4a6eb7 Add ability to play plex media as the non-primary user (#122039)
* Adds ability to play media as the non-primary user

* Add return type for set function
2024-09-08 15:42:26 +02:00
Andrew Jackson
99a50fe874 Correct Mastodon IOT class (#125511)
* Correct iot class

* Fix hassfest
2024-09-08 15:40:53 +02:00
G Johansson
65b48aa903 Add config flow to Mold indicator (#122600)
* Add config flow to Mold indicator

* strings

* Add tests

* Is a helper

* Add back platform yaml

* Fixes

* Remove wait
2024-09-08 15:21:53 +02:00
treetip
af62e8267f Add set_profile service for Vallox integration (#120225)
* Add set_profile service for Vallox integration

* Merge profile constants, use str input for service

* add service test and some related refactoring

* Change service uom to 'minutes'

Co-authored-by: Sebastian Lövdahl <slovdahl@hibox.fi>

* Update icons.js format after rebase

* Translate profile names for service

* Fix test using wrong dict

---------

Co-authored-by: Sebastian Lövdahl <slovdahl@hibox.fi>
2024-09-08 15:07:42 +02:00
mvn23
45ab6e9b06 Deprecate opentherm_gw configuration through configuration.yaml (#125045)
* Create an issue in the issue registry if deprecated config is found in configuration.yaml
* Add deprecation comments to functions that can be removed after deprecation period
* Add test for the creation of a deprecation issue

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-08 14:45:37 +02:00
G Johansson
a7a219b99b Deprecate aux_heat in econet (#125365)
* Deprecate aux_heat in econet

* strings

* Use generator
2024-09-08 14:24:39 +02:00
G Johansson
c2d5696b5b Add validation to climate hvac mode (#125178)
* Add validation to climate hvac mode

* Make softer

* Remove string

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-09-08 14:24:12 +02:00
G Johansson
2ef37f01b1 Deprecate aux_heat from Nexia climate entity, implement switch (#125250)
* Remove deprecated aux_heat from nexia

* Add back aux_heat

* Raise issue
2024-09-08 14:23:24 +02:00
G Johansson
84def0c041 Deprecate aux_heat in elkm1 (#125372)
* Deprecate aux_heat in elkm1

* Update homeassistant/components/elkm1/switch.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-08 14:23:00 +02:00
G Johansson
26ede9a679 Fix yale_smart_alarm on missing key (#125508) 2024-09-08 14:06:40 +02:00
Jan Rieger
c0ee12ca41 Add translation to Jellyfin (#123857)
* Add translation to Jellyfin

* Fix

* Address feedback
2024-09-08 14:00:34 +02:00
dougiteixeira
926ffe536c Fix UI config validation for button and switch actions in Template (#121810)
Fix IU config validation for button and switch actions in Template
2024-09-08 13:59:54 +02:00
Luke Lashley
2b2f5d6693 Add sleep to map select for Roborock (#122625)
* Add sleep to map select

* Update homeassistant/components/roborock/select.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-08 13:56:42 +02:00
Guido Schmitz
d4f0aaa089 Add last restart sensor to devolo_home_network (#122190)
* Add last restart sensor to devolo_home_network

* Add missing test

* Rename fetch function

* Fix mypy
2024-09-08 13:50:36 +02:00
Mr. Bubbles
5b434aae6e Add DeviceInfo to Bring integration (#122419)
* Add DeviceInfo to Bring integration

* deeplink to shopping list

* Move device info to a entity base class
2024-09-08 13:45:12 +02:00
G Johansson
1ffd797e0a Clean up Mold indicator (#123080)
* Improve code quality on mold_indicator

* mypy

* Fix mypy
2024-09-08 13:11:57 +02:00
Simon
8acc027f38 Add voice settings to ElevenLabs options flow (#123265)
Add voice settings to options flow
2024-09-08 13:11:26 +02:00
Joakim Plate
3139a7e431 Adjust generic hygrostat to detect reported events for stale tracking (#124109)
* Listen to reported events for stale check

* Always enable stale sensor tracking

There is no reason not to have this enabled
now that we track reported events for sensors.

* Remove default stale code

* Adjust for ruff change
2024-09-08 12:51:08 +02:00
Joakim Plate
e7cb646a58 Use json data instead of timedelta for tests in generic hygrostat (#124111)
Use json data instead of timedelta for tests
2024-09-08 12:50:29 +02:00
Kevin Stillhammer
ec9f50317f Allow waze_travel_time multiple excl/incl filter (#117252)
* Allow multiple excl/incl filter

* Use list comprehension for should_include

* Do not use mutable object as default param

* Inline migration func
2024-09-08 12:50:04 +02:00
Mr. Bubbles
fd0c63fe52 Add text-selector autocomplete in Bring config flow (#124063)
Add autocomplete to Bring config flow schema
2024-09-08 12:29:42 +02:00
Markus Jacobsen
31aef86c0f Add various assertions to Bang & Olufsen testing (#125429)
Add various assertions
2024-09-08 12:22:21 +02:00
Markus Jacobsen
943b96e7a1 Fix Bang & Olufsen testing typing (#125427)
* Fix test parameter typed as callable instead of context manager

* Add missing AsyncMock typing
2024-09-08 12:18:32 +02:00
Arie Catsman
74b78307ee Add balanced grid import/export to enphase_envoy (#123154)
* Add balanced grid import/export to enphase_envoy

* rebuild sensor snapshot after dev merge

* Cleanup snapshot file
2024-09-08 12:15:00 +02:00
Josef Zweck
c0492d4af4 Add reconfigure for lamarzocco (#122160)
* add reconfigure

* fix strings, add to label

* Update homeassistant/components/lamarzocco/config_flow.py

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Update test_config_flow.py

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

* ruff

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-08 12:04:35 +02:00
Nerdix
f5b754a382 Reorder openweathermap modes according to recommendation in documentation (#125395)
Reorder modes and default to new API version 3
2024-09-08 12:03:14 +02:00
Simon Lamon
cee695da28 Add missing previous and next commands in LinkPlay (#125450)
Previous / Next commands
2024-09-08 12:00:03 +02:00
Arie Catsman
2ef1c96325 Include all enphase_envoy devices in async_remove_config_entry_device (#124533)
* Include all enphase_envoy devices in async_remove_config_entry_device

* refactor if tests
2024-09-08 11:56:23 +02:00
Marc Mueller
d3badb88ef Fix solarlog test RuntimeWarning (#125504) 2024-09-08 11:43:50 +02:00
Joost Lekkerkerker
1f80b803f7 Fix after review comments for Acmeda (#125501)
Fix
2024-09-08 11:03:18 +02:00
TimL
2ea41c90b5 Bump pymslight to 0.0.15 (#125455)
Bump pymslight 0.0.15 for Smlight integration
2024-09-08 11:00:10 +02:00
Alan Murray
3fa24f87c0 Change of acmeda element unique_id (#124963)
* Update base.py

Change unique_id to be explicitly a string.

* Update __init__.py

Add unique id migration

* unique_id migration unit tests

* Update __init__.py

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

* Update __init__.py

Fixed ruff formatting issue

* Update __init__.py

* Update __init__.py

* In tests, load entity registries as test fixtures

* Fix

* Fix

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Joostlek <joostlek@outlook.com>
2024-09-08 10:42:54 +02:00
Willem-Jan van Rootselaar
bfe19e82ff Add tests for BSBLAN climate component (#124524)
* chore: Add tests for BSBLAN climate component

* fix return types

* fix MAC data

* chore: Update BSBLAN climate component tests

used setup from conftest  added setup for farhenheit temp unit

* chore: Update BSBLAN climate component tests

use syrupy to compare results

* add test for temp_unit

* update climate tests

set current_temperature to None in test case. Is this the correct way for testing?

* chore: Update BSBLAN diagnostics to handle asynchronous data retrieval

* chore: Refactor BSBLAN conftest.py to simplify fixture and patching

* chore: Update BSBLAN climate component tests

100% test coverage

* chore: Update BSBLAN diagnostics to handle asynchronous data retrieval

* chore: Update snapshots

* Fix BSBLAN climate test for async_set_preset_mode

- Update test_async_set_preset_mode to correctly handle ServiceValidationError
- Check for specific translation key instead of full error message
- Ensure consistency between local tests and CI environment
- Import ServiceValidationError explicitly for clarity

* Update homeassistant/components/bsblan/entity.py

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

* chore: Update BSBLAN conftest.py to simplify fixture and patching

* chore: Update BSBLAN integration setup function parameter name

* chore: removed set_static_value

* refactor: Improve BSBLANClimate async_set_preset_mode method

This commit refactors the async_set_preset_mode method in the BSBLANClimate class to improve code readability and maintainability. The method now checks if the HVAC mode is not set to AUTO and the preset mode is not NONE before raising a ServiceValidationError.

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

* refactor: Improve tests

test_celsius_fahrenheit
test_climate_entity_properties
test_async_set_hvac_mode

test_async_set_preset_mode still broken. Not sure why hvac mode will not set. THis causes error with preset mode set

* update snapshot

* fix DOMAIN bsblan

* refactor: Improve BSBLANClimate async_set_data method

* refactor: fix last tests

* refactor: Simplify async_get_config_entry_diagnostics method

* refactor: Improve BSBLANClimate async_set_temperature method

This commit improves the async_set_temperature method in the BSBLANClimate class. It removes the unnecessary parameter "expected_result" and simplifies the code by directly calling the service to set the temperature. The method now correctly asserts that the thermostat method is called with the correct temperature.

* refactor: Add static data to async_get_config_entry_diagnostics

* refactor: Add static data to async_get_config_entry_diagnostics

right place

* refactor: Improve error message for setting preset mode

This commit updates the error message in the BSBLANClimate class when trying to set the preset mode.

* refactor: Improve tests

* Fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-08 10:41:54 +02:00
Avi Miller
5108e1a1cd Bump aiolifx and aiolifx-themes to support more than 82 zones (#125487)
Signed-off-by: Avi Miller <me@dje.li>
2024-09-08 09:53:32 +02:00
Andre Lengwenus
5e1b4b2d23 Clean up tests for LCN (#125493)
* Remove patches on 3rd party module level

* Cleanup test_init

* Cleanup platform tests

* Cleanup test_services

* Cleanup test_websockets

* Cleanup test_device_trigger

* Cleanup test_events

* Remove unused fixture
2024-09-08 09:20:57 +02:00
J. Nick Koston
03a6eb26be Bump zeroconf to 0.134.0 (#125491)
changelog: https://github.com/python-zeroconf/python-zeroconf/compare/0.133.0...0.134.0
2024-09-08 09:10:46 +02:00
J. Nick Koston
0a11acf7ae Replace linear search in unit_system with dict lookup (#125485) 2024-09-07 23:49:44 -04:00
Álvaro Fernández Rojas
ab29718a45 Update aioairzone to v0.9.0 (#125476)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-09-07 22:32:36 +02:00
Dian
7e7a6e4937 Bump xiaomi-ble to 0.32.0 (#125461) 2024-09-07 14:33:48 -05:00
Marcel van der Veldt
c53c2d7e64 Add model ID to Matter DeviceInfo (#125341)
* Add model ID to Matter DeviceInfo

* convert to string

* Test device registry

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-09-07 11:57:57 -04:00
Hessel
6e38cf878e Clean up test for Wallbox integration (#125433)
feat: Update API requests in wallbox integration tests
2024-09-07 15:34:48 +02:00
mvn23
066503b838 Fix docstrings in opentherm_gw (#125456) 2024-09-07 12:18:54 +01:00
tmenguy
3e70342265 Fix renault plug state (#125421)
* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes #124682 HA ticket

* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes #124682 HA ticket
2024-09-07 12:38:59 +02:00
tronikos
17994ff245 Request one data point in statistics_during_period in Opower (#124480) 2024-09-07 01:47:27 -07:00
Marcel van der Veldt
cbd884d54a Add discovery schemas for Matter 1.3 power/energy sensors (#125403)
* Add missing discovery schemas for (Matter 1.3) Power/Energy measurements

* Prevent discovery of custom cluster if 1.3 cluster present

* add tests

* Use f-strings

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-09-07 07:55:08 +02:00
J. Nick Koston
b8c3a44d81 Bump yarl to 1.10.0 (#125446)
changelog: https://github.com/aio-libs/yarl/compare/v1.9.11...v1.10.0
2024-09-07 07:36:34 +02:00
J. Nick Koston
ce28d8a92c Bump yalexs to 8.6.4 (#125442)
adds a debounce to the updates to ensure we do
not request the activities api too often if
the websocket sends rapid updates

fixes #125277
2024-09-06 19:35:57 -05:00
Hessel
457e66527a Add model ID to WallboxEntity (#125434)
* chore: Update WallboxEntity model ID to use CHARGER_PART_NUMBER_KEY

The WallboxEntity model ID is updated to use the CHARGER_PART_NUMBER_KEY value from the coordinator data. This change ensures consistency and accuracy in identifying the model of the Wallbox entity.

* Update WallboxEntity model ID to use CHARGER_PART_NUMBER_KEY

* chore: Update WallboxEntity model ID to use CHARGER_PART_NUMBER_KEY

* remove obsolete key from test
2024-09-06 20:40:47 +02:00
mvn23
b9bd8f6b34 Add switch platform to opentherm_gw (#125410)
* WIP

* * Add switch platform
* Add tests for switches

* Remove unnecessary block_till_done-s

* Test that entities get added in a disabled state separately

* Convert to parametrized test

* Use fixture to add entities enabled.
2024-09-06 18:30:04 +02:00
IceBotYT
cd3059aa14 Nice G.O. code quality improvements (#124319)
* Bring Nice G.O. up to platinum

* Switch to listen in coordinator

* Tests

* Remove parallel updates from coordinator

* Unsub from events on config entry unload

* Detect WS disconnection

* Tests

* Fix tests

* Set unsub to None after unsubbing

* Wait 5 seconds before setting update error to prevent excessive errors

* Tweaks

* More tweaks

* Tweaks part 2

* Potential test for hass stopping

* Improve reconnect handling and test on Homeassistant stop event

* Move event handler to entry init

* Patch const instead of asyncio.sleep

---------

Co-authored-by: jbouwh <jan@jbsoft.nl>
2024-09-06 18:22:59 +02:00
Markus Jacobsen
741add0666 Replace strings with constants in Bang & Olufsen testing (#125423)
Replace strings with constants in service calls
2024-09-06 18:09:43 +02:00
Michael Hansen
ee59303d3c Use first media player announcement format for TTS (#125237)
* Use ANNOUNCEMENT format from first media player for tts

* Fix formatting

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-09-06 10:57:09 -05:00
Andre Lengwenus
20639b0f02 Add tests for LCN climate and scene platform (#124466)
* Add tests for LCN climate and scene platform

* Add type hints

* Add snapshots for test_climate

* Add snapshots for test_scene

* Replace await_called assertion with snapshots

* Remove snapshots for simple status changes

* Test platform setup using snapshot_platform

* Fix type hints

* Patch homeassistant.components.lcn context instead of pypck module

* Fix side effects caused by patching PchkConnectionManager in lcn platform context
2024-09-06 17:56:46 +02:00
Arie Catsman
ea7b2ecec0 Improve coordinator test coverage for enphase_envoy (#122375)
* Improve coordinator test coverage for enphase_envoy

* rename to test_coordinator to test_init for enphase_envoy

* Mock pyenphase _obtain_token instead of httpx auth requests in enphase_envoy tests.

* Move EnvoyTokenAuth patch to mock_envoy of enphase_envoy
2024-09-06 17:14:37 +02:00
Erik Montnemery
09989e6184 Fix UnboundLocalError in recorder (#125419) 2024-09-06 17:14:25 +02:00
Michał Jaworski
883e33e72a Fix mired range in blebox color temp mode lights (#124258)
* fix: use default mired range in belbox lights running in color temp mode

* fix: ruff
2024-09-06 16:59:14 +02:00
Arie Catsman
49b07b3749 Provide same entities for all Enphase_envoy CT types (#124531)
Provide same entities for all Enphase_envoy CT types.
2024-09-06 16:56:43 +02:00
tdfountain
6b75c86a17 Move ambient sensors (temperature and humidity) to diagnostic in NUT (#124180)
Move ambient sensors (temperature and humidity) to Diagnostic
2024-09-06 16:53:05 +02:00
tdfountain
f86bd3dfee Improve consistency of sensor strings to reduce confusion in NUT (#124184)
Improve consistency of sensor strings to reduce confusion
2024-09-06 16:52:49 +02:00
Marlon
069b7a45ed Set min_power similar to max_power to support all inverters from apsystems (#124247)
Set min_power similar to max_power to support all inverters from apsystems ez1 series
2024-09-06 16:52:32 +02:00
Erik Montnemery
e3e48ff9b7 Use PEP 695 for decorator typing with type aliases in zha (#124235) 2024-09-06 16:52:03 +02:00
epenet
33814d1180 Add model ID to sfr_box (#125400) 2024-09-06 10:50:17 -04:00
Paulus Schoutsen
f126a6024e Migrate ESPHome to assist satellite (#125383)
* Migrate ESPHome to assist satellite

* Address comments
2024-09-06 10:48:42 -04:00
Michał Jaworski
b6d45a5a07 Bump blebox_uniapi to v2.5.0 (#124298)
blebox: bump blebox_uniapi to v2.5.0
2024-09-06 16:46:54 +02:00
Kevin Worrel
f6c681eb5d Remove support for area, device, or entity targets for screenlogic actions (#123432)
* Remove non-configentry service target

* Remove unneeded tests

* Remove unneeded issue strings
2024-09-06 16:46:06 +02:00
Alexandre TRUPIN
c4cc158a77 Bump sfrbox-api to 0.0.10 (#125405)
* bump sfr_box requirement to 0.0.10

* upate manifest file

* Handle None values

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-09-06 16:18:47 +02:00
G Johansson
e58cf00a96 Remove deprecated aux_heat from ecobee (#125246) 2024-09-06 16:18:24 +02:00
Paulus Schoutsen
6976a66758 Migrate VoIP to use assist satellite (#125381)
* Migrate VoIP to assist satellite

* Fix flaky test
2024-09-06 09:11:51 -05:00
TimL
6b1fc00910 Improve handling of old firmware versions (#125406)
* Update Info fixture with new fields from pysmlight 0.0.14

* Create repair if device is running unsupported firmware

* Add test for legacy firmware info

* Add strings for repair issue
2024-09-06 09:46:08 -04:00
Pierre Ståhl
8168b8fce4 Bump pyatv to 0.15.1 (#125412) 2024-09-06 09:43:16 -04:00
Joost Lekkerkerker
1e6b6fef7e Revert #122676 Yamaha discovery (#125216)
Revert Yamaha discovery
2024-09-06 09:42:56 -04:00
Robert Svensson
73f04e3ede Add filter run time for deCONZ air purifiers (#123306)
* Add filter run time for deCONZ air purifiers

* Add duration and second

* Fix review comments

* Update tests/components/deconz/snapshots/test_sensor.ambr

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-06 15:41:49 +02:00
G Johansson
9f469c08d1 Code quality improvement on local_file (#125165)
* Code quality improvement on local_file

* Fix

* No translation

* Review comments
2024-09-06 15:35:38 +02:00
J. Nick Koston
051a28b55a Remove unneeded wrapping of URL in URL in network helper (#125265)
* Remove unneeded wrapping of URL in URL in network helper

* fix mocks
2024-09-06 15:34:52 +02:00
J. Nick Koston
ff449e7741 Bump yarl to 1.9.11 (#125287)
* Bump yarl to 1.9.10

changelog: https://github.com/aio-libs/yarl/compare/v1.9.9...v1.9.10

* 11
2024-09-06 15:23:22 +02:00
Noah Husby
8d239d368b Bump aiorussound to 3.0.4 (#125285)
feat: bump aiorussound to 3.0.4
2024-09-06 15:22:39 +02:00
epenet
3a5309e9a0 Improve config flow type hints in tellduslive (#125299) 2024-09-06 15:20:39 +02:00
epenet
86ef7bab28 Improve config flow type hints in totalconnect (#125300) 2024-09-06 15:20:11 +02:00
epenet
f9928a5843 Fix location_id datatype in totalconnect tests (#125298)
Adjust location_id type in totalconnect tests
2024-09-06 15:19:54 +02:00
Stefano Sonzogni
2c99f060f0 Add binary sensors for motion detection Comelit simple home (#125200)
* Add binary sensors for motion detection

* sort platforms

* use _attr_device_class property and optimizations

* use static _attr_device_class property
2024-09-06 15:18:40 +02:00
GeoffAtHome
543f986955 Improve geniushub test coverage (#124157)
* Add tests for local connection

* Test cloud setup

* Improve tests.

* Simplied coverage test to cloud setup.

* Mock out library and add snapshots

* Mock out library and add snapshots

* Update tests/components/geniushub/conftest.py

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

* Attempt to make it nice

* Fix

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-09-06 15:17:50 +02:00
epenet
b68c90d59a Improve config flow type hints in vulcan (#125308)
* Improve config flow type hints in vulcan

* Adjust tests
2024-09-06 15:16:47 +02:00
epenet
66c6cd2a10 Improve config flow type hints in xiaomi_aqara (#125316) 2024-09-06 15:16:32 +02:00
Eric Shtivelberg
f5f8c44ca6 Add Habitica up/down attributes for tasks (#125356)
add: up/down
2024-09-06 15:08:30 +02:00
epenet
58056c49f7 Improve config flow type hints (t-z) (#125315) 2024-09-06 15:08:13 +02:00
Simon Lamon
af0a6d2820 Improve play media support in LinkPlay (#125205)
Improve play media support in linkplay
2024-09-06 15:02:38 +02:00
Jan Rieger
f3e2c51774 Add translations to Xiaomi Miio (#123822)
* Add translations to Xiaomi Miio

* Deduplicate translations
2024-09-06 14:59:02 +02:00
epenet
053e38db38 Improve config flow type hints in volumio (#125318) 2024-09-06 14:57:04 +02:00
Paul Bottein
ba81a68982 Update frontend to 20240906.0 (#125409) 2024-09-06 14:49:58 +02:00
steffenrapp
f8c94fd83f Remove attributes from Nuki entities (#125348)
* Remove attributes from Nuki entities

* remove tests
2024-09-06 14:49:05 +02:00
Tony
9777ed2e62 Rename "Ruckus Unleashed" integration to "Ruckus" (#125392) 2024-09-06 14:48:16 +02:00
Matrix
aba23eb513 Add YoLink temperature sensor YS8008 support (#125408)
Add YS8008 support
2024-09-06 14:47:31 +02:00
TimL
0eda451c24 Add Switch platform to Smlight integration (#125292)
* Add switch platform to Smlight

* Add strings for switch platform

* Add tests for Smlight switch platform

* Regenerate snapshot

* Address review comments

* Use is_on property for updating switch state

* Address review comments

---------

Co-authored-by: Tim Lunn <tim@feathertop.org>
2024-09-06 14:25:55 +02:00
Marcel van der Veldt
8f38b7191a Fix for Hue sending effect None at turn_on command while no effect is active (#125377)
* Fix for Hue sending effect None at turn_on command while no effect is active

* typo

* update tests
2024-09-06 14:06:46 +02:00
Paulus Schoutsen
ff3cabbf3a Small Assist Satellite fixes (#125384) 2024-09-06 07:36:02 -04:00
jesperraemaekers
dfcfe78732 Add weheat core integration (#123057)
* Add empty weheat integration

* Add first sensor to weheat integration

* Add weheat entity to provide device information

* Fixed automatic selection for a single heat pump

* Replaced integration specific package and removed status sensor

* Update const.py

* Add reauthentication support for weheat integration

* Add test cases for the config flow of the weheat integration

* Changed API and OATH url to weheat production environment

* Add empty weheat integration

* Add first sensor to weheat integration

* Add weheat entity to provide device information

* Fixed automatic selection for a single heat pump

* Replaced integration specific package and removed status sensor

* Add reauthentication support for weheat integration

* Update const.py

* Add test cases for the config flow of the weheat integration

* Changed API and OATH url to weheat production environment

* Resolved merge conflict after adding weheat package

* Apply suggestions from code review

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

* Added translation keys, more type info and version bump the weheat package

* Adding native property value for weheat sensor

* Removed reauth, added weheat sensor description and changed discovery of heat pumps

* Added unique ID of user to entity

* Replaced string by constants, added test case for duplicate unique id

* Removed duplicate constant

* Added offline scope

* Removed re-auth related code

* Simplified oath implementation

* Cleanup tests for weheat integration

* Added oath scope to tests

---------

Co-authored-by: kjell-van-straaten <kjell.van.straaten@wefabricate.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-06 11:58:01 +02:00
Shay Levy
ff20131af1 Use smlight discovery hostname as device name (#125359)
* Use smlight discovery hostname as device name

* Update reauth flow name

* Drop host from description
2024-09-06 11:49:10 +02:00
Ryan Mattson
ccbc300b68 Lyric: fixed missed snake case conversions (#125382)
fixed missed snake case conversions
2024-09-06 11:45:39 +02:00
epenet
84dcfb6ddc Replace SW version by model ID in renault device info (#125399)
* Replace SW_VERSION by MODEL_ID in renault device info

* Simplify PR

* Fix tests
2024-09-06 11:45:13 +02:00
Sid
1db68327f9 Enable Ruff PTH for the script directory (#124441)
* Enable Ruff PTH for the script directory

* Address review comments

* Fix translations script

* Update script/hassfest/config_flow.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-09-06 11:33:01 +02:00
dontinelli
7752789c3a Increase coordinator update_interval for fyta (#125393)
* Increase update_interval

* Update homeassistant/components/fyta/coordinator.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-06 11:23:30 +03:00
TimL
54c15e7e0a Bump pysmlight to 0.0.14 (#125387)
Bump pysmlight 0.0.14 for smlight
2024-09-06 11:20:12 +03:00
Paulus Schoutsen
0092796fd2 Add model ID to linkplay (#125370) 2024-09-06 09:51:53 +02:00
Andre Lengwenus
187a38c91f Add tests for LCN actions / services (#125391)
* Add tests for services/actions

* Add snapshots for services/actions

* Use constants for service names and parameters

* Remove snapshot names
2024-09-06 09:51:11 +02:00
Dave Leaver
b025942a14 Fix controlling AC temperature in airtouch5 (#125394)
Fix controlling AC temperature
2024-09-06 09:06:33 +02:00
Andre Lengwenus
0e515b2e1f Bump pypck to 0.7.22 (#125389) 2024-09-06 08:29:49 +02:00
TimL
a341bfd8ca Add binary_sensor platform for Smlight integration (#125284)
* Support binary_sensors for SMLight integration

* Add strings for binary sensors

* Add tests for binary_sensor platform

* Update binary sensor docstring

Co-authored-by: Shay Levy <levyshay1@gmail.com>

* Regenerate snapshot

---------

Co-authored-by: Shay Levy <levyshay1@gmail.com>
Co-authored-by: Tim Lunn <tim@feathertop.org>
2024-09-06 08:11:50 +02:00
Sid
f80acdada0 Bump ruff to 0.6.4 (#125385)
* Bump ruff to 0.6.4

* fix Dockerfile
2024-09-06 08:08:40 +02:00
Erik Montnemery
cf049a07c2 Don't allow templating min, max, step in config entry template number (#125342) 2024-09-06 07:59:22 +02:00
Erik Montnemery
0ca0836e83 Correct check for removed index in recorder test (#125323) 2024-09-06 07:21:41 +02:00
Michael Hansen
60b0f0dc53 Add assist satellite entity component (#125351)
* Add assist_satellite

* Update homeassistant/components/assist_satellite/manifest.json

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Update homeassistant/components/assist_satellite/manifest.json

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Add platform constant

* Update Dockerfile

* Apply suggestions from code review

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

* Address comments

* Update docstring async_internal_announce

* Update CODEOWNERS

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-09-05 21:16:30 -04:00
Paulus Schoutsen
c3921f2112 Add model ID to unifiprotect (#125376) 2024-09-05 19:44:28 -04:00
Paulus Schoutsen
aa619c5594 Add model ID to awair (#125373)
* Add model ID to awair

* less diff
2024-09-05 19:42:50 -04:00
Paulus Schoutsen
0677a256ec Add model ID to Wemo (#125368) 2024-09-05 23:03:50 +02:00
Paulus Schoutsen
97ffbf5aad Add model ID to samsungtv (#125369) 2024-09-05 23:03:37 +02:00
Paulus Schoutsen
006b2da14e Add model ID to roborock (#125366) 2024-09-05 16:52:45 -04:00
Paulus Schoutsen
56b4ddc6b4 Add model ID to Sonos (#125364) 2024-09-05 16:52:17 -04:00
G Johansson
2c0c0b9e21 Extend deprecation of aux_heat in ClimateEntity (#125360) 2024-09-05 22:34:35 +02:00
Mark Ruys
9e312f2063 Add Sensoterra integration (#119642)
* Initial version

* Baseline release

* Refactor based on first PR feedback

* Refactoring based on second PR feedback

* Initial version

* Baseline release

* Refactor based on first PR feedback

* Refactoring based on second PR feedback

* Refactoring based on PR feedback

* Refactoring based on PR feedback

* Remove extra attribute soil type

Soil type isn't really a sensor, but more like a configuration entity.
Move soil type to a different PR to keep this PR simpler.

* Refactor SensoterraSensor to a named tuple

* Implement feedback on PR

* Remove .coveragerc

* Add async_set_unique_id to config flow

* Small fix based on feedback

* Add test form unique_id

* Fix

* Fix

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
2024-09-05 21:37:44 +02:00
G Johansson
bbeecb40ae Remove deprecated aux_heat from zha (#125247)
Remove aux_heat from zha
2024-09-05 21:35:24 +02:00
YogevBokobza
48c9361c01 Bump aioswitcher to 4.0.3 (#125355) 2024-09-05 22:34:11 +03:00
Robert Contreras
d686b877b1 Home Connect add FridgeFreezer switch entities (#122881)
* Home Connect add FridgeFreezer switch entities

* Fix unrelated test

* Implemented requested changes from review

* Move exist_fn check code to setup

* Assign entity_description during init

* Resolve issue with functional testing
2024-09-05 20:52:12 +02:00
Bouwe Westerdijk
d2d01b337d Bump plugwise to v1.0.0 (#125354) 2024-09-05 20:16:11 +02:00
peteS-UK
b0bfe71b9b Fix typo in squeezebox (#125352)
Spelling Correction on SERVER_MODEL
2024-09-05 18:44:19 +02:00
Phill (pssc)
38f3fa0210 Add Squeezebox server service binary sensors (#122473)
* squeezebox add binary sensor + coordinator

* squeezebox add connected via for media_player

* squeezebox add Player type for player

* Add more type info

* Fix linter errors

* squeezebox use our own status entity

* squeezebox rework device handling based on freedback

* Fix device creation

* squeezebox rework coordinator error handling

* Fix lint type error

* Correct spelling

* Correct spelling

* remove large comments

* insert small comment

* add translation support

* Simply sensor

* clean update function, minimise comments to the useful bits

* Fix after testing

* Update homeassistant/components/squeezebox/entity.py

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

* move data prep out of Device assign for clarity

* stop being a generic api

* Humans need to read the sensors...

* ruff format

* Humans need to read the sensors...

* Revert "ruff format"

This reverts commit 8fcb8143e7.

* ruff format

* Humans need to read the sensors...

* errors after testing

* infered

* drop context

* cutdown coordinator for the binary sensors

* add tests for binary sensors

* Fix import

* add some basic media_player tests

* Fix spelling and file headers

* Fix spelling

* remove uuid and use service device cat

* use diag device

* assert execpted value

* ruff format

* Update homeassistant/components/squeezebox/__init__.py

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

* Simplify T/F

* Fix file header

* remove redudant check

* remove player tests from this commit

* Fix formatting

* remove unused

* Fix function Type

* Fix Any to bool

* Fix browser tests

* Patch our squeebox componemt not the server in the lib

* ruff

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-05 16:49:07 +02:00
Erik Montnemery
86ae70780c Refactor recorder retryable_database_job decorator (#125306) 2024-09-05 13:09:27 +02:00
mvn23
65e16b4814 Split opentherm_gw entity base class (#125330)
Add OpenThermStatusEntity to allow entities that don't need status updates
2024-09-05 13:03:16 +02:00
Adam Pasztor
70966c2b63 Add new data types to ADS integration (#125201)
* feat: Introduce new data types to ADS integration.

* refactor: ADS data unpacking based on PLC data type

* refactor: handle BOOL and STRING as special cases.
2024-09-05 12:07:19 +02:00
Malte Franken
ba7f36328d Add diagnostics to GeoNet NZ Quakes integration (#125320)
* add diagnostics platform

* add tests

* add snapshot data

* remove from no diagnostics list
2024-09-05 11:35:36 +02:00
TimL
511ecf98d5 Add reauth flow for Smlight (#124418)
* Add reauth flow for smlight integration

* add strings for reauth

* trigger reauth flow on authentication errors

* Add tests for reauth flow

* test for update failed on auth error

* restore name title placeholder

* raise config entry error to trigger reauth

* Add test for reauth triggered at startup

---------

Co-authored-by: Tim Lunn <tim@feathertop.org>
2024-09-05 11:02:05 +02:00
Malte Franken
b5831344a0 Add diagnostics to GDACS integration (#125296)
* simple diagnostics

* add service status information

* remove from no diagnostics list

* wip

* cater for the case where status info is undefined

* make test work

* code reformatted

* add snapshot data

* simplify code
2024-09-05 10:53:12 +02:00
Erik Montnemery
984eba809c Simplify generic decorators in recorder (#125301)
* Simplify generic decorators in recorder

* Remove additional case
2024-09-05 10:16:44 +02:00
epenet
f778033bd8 Improve config flow type hints in ukraine_alarm (#125302) 2024-09-05 09:55:57 +02:00
Erik Montnemery
a8f2204f4f Teach recorder data migrator base class to update MigrationChanges (#125214)
* Teach recorder data migrator base class to update MigrationChanges

* Bump migration version

* Improve test coverage

* Update migration.py

* Revert migrator version bump

* Remove unneeded change
2024-09-05 08:56:18 +02:00
Simon Lamon
4c56cbe8c8 Add follower to the PlayingMode enum (#125294)
Update media_player.py
2024-09-05 08:50:49 +02:00
J. Nick Koston
71d35a03e1 Switch hassio to use with_path where possible (#125268)
* Switch hassio to use with_path where possible

Any place we are joining to the root url, we can use with_path
as its much faster

* revert
2024-09-05 08:12:43 +02:00
Marc Mueller
c8fd48523f Use TypeVar defaults for Generator (#125228) 2024-09-04 18:10:21 -10:00
J. Nick Koston
fbd3bf7a98 Bump yarl to 1.9.9 (#125264) 2024-09-04 11:32:33 -10:00
J. Nick Koston
a0356f587e Fix yarl binary wheel builds for armv7l and armhf (#125270) 2024-09-04 11:32:08 -10:00
Jordi
199a4b725b Increase AquaCell timeout and handle timeout exception properly (#125263)
* Increase timeout and add handling of timeout exception

* Raise update failed instead of config entry error
2024-09-04 23:22:31 +02:00
Raj Laud
505df84783 Squeezebox remove deprecated sync and unsync services (#125271)
* Squeezebox remove deprecated sync and unsync

* Squeezebox remove sync group attribute
2024-09-04 23:17:39 +02:00
Shay Levy
baa9473383 Address BTHome review comment (#125259)
* Address BTHome review comment

* Review comment

Co-authored-by: Ernst Klamer <e.klamer@gmail.com>

* generator expression

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

---------

Co-authored-by: Ernst Klamer <e.klamer@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-09-04 23:24:52 +03:00
ilan
ba5d23290a Add madvr diagnostics (#125109)
* feat: add basic diagnostics

* fix: add mock data

* fix: regen snapshots
2024-09-04 21:57:37 +02:00
Shai Ungar
adda02b6b1 Add service to 17track to archive package (#123493)
* Add service archive package

* Update homeassistant/components/seventeentrack/icons.json

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

* CR fix in tests

* CR fix in services.py

* string references

* extract constant keys

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-04 21:56:11 +02:00
G Johansson
1f59bd9f92 Don't show input panel if default code provided in envisalink (#125256) 2024-09-04 21:49:28 +02:00
G Johansson
b61678d39c Fix blocking call in yale_smart_alarm (#125255) 2024-09-04 21:14:54 +02:00
Christopher Fenner
b23297bb7e Add hysteresis entity for heat pumps via ViCare (#124294)
* add hysteresis entity

* update PyViCare-neo dependency

* add hysteresis switch on / of entities

* Revert "add hysteresis entity"

This reverts commit dcb5680d0c.
2024-09-04 20:32:40 +02:00
TimL
f56c38d69b Add uptime sensors for Smlight (#124408)
* Add uptime sensor as derived sensor class

* Add strings for uptime sensors

* Update sensor tests to include uptime sensors

* test zigbee uptime when disconnected
2024-09-04 20:31:56 +02:00
tronikos
c2b24dd355 Add debug logging in get_cost_reads in opower (#124473)
Add debug statements in get_cost_reads in opower
2024-09-04 20:30:24 +02:00
Tal Taub
c4c8e74a8a Add Custom Drink Entities Tami4 Edge (#124506)
* Add drinks as button entities instead of using actions

* Remove button extensions

* Add an extension to create new buttons

* Use translation key for buttons names

* Change translation key wording

* Call async_add_entities once

* Add icons

* Update homeassistant/components/tami4/button.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-04 20:29:06 +02:00
G Johansson
c4029300c2 Remove deprecated aux_heat from honeywell (#125248) 2024-09-04 20:28:45 +02:00
J. Nick Koston
52320844fc Revert "Disable IPv6 in the opower integration to fix AEP utilities" (#125208)
Revert "Disable IPv6 in the opower integration to fix AEP utilities (#107203)"

This reverts commit 2a9a046fab.
2024-09-04 08:05:13 -10:00
Pete Sage
b4e20409de Add Sonos tests and update error handling for unknown media (#124578)
* initial commit

* simplify tests
2024-09-04 20:03:26 +02:00
Michael Hansen
4ecc6555bf Add support for sample bytes in preferred TTS format (#125235) 2024-09-04 13:42:41 -04:00
mvn23
892c32c8b7 Add button platform to opentherm_gw (#125185)
* Add button platform to opentherm_gw

* Add tests for button.py

* Update tests/components/opentherm_gw/test_button.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-04 19:20:05 +02:00
Artur Pragacz
bad305dcbf Add Onkyo to strict typing (#124617) 2024-09-04 19:11:34 +02:00
TimL
7266a16295 Add Button platform for Smlight integration (#124970)
* Add button platform for smlight integration

* Add strings required for button platform

* Add commands api to smlight mock client

* Add tests for smlight button platform

* Move entity category to class

* Disable by default Zigbee flash mode
2024-09-04 19:10:59 +02:00
epenet
416a2de179 Improve config flow type hints in screenlogic (#125199) 2024-09-04 19:09:41 +02:00
Christopher Fenner
349ea35dc3 Fix device identifier in ViCare integration (#124483)
* use correct serial

* add migration handler

* adjust init call

* add missing types

* adjust init call

* adjust init call

* adjust init call

* adjust init call

* Update types.py

* fix loop

* fix loop

* fix parameter order

* align parameter naming

* remove comment

* correct init

* update

* Update types.py

* correct merge

* revert type change

* add test case

* add helper

* add test case

* update snapshot

* add snapshot

* add device.serial data point

* fix device unique id

* update snapshot

* add comments

* update nmigration

* fix missing parameter

* move static parameters

* fix circuit access

* update device.serial

* update snapshots

* remove test case

* Update binary_sensor.py

* convert climate entity

* Update entity.py

* update snapshot

* use snake case

* add migration test

* enhance test case

* add test case

* Apply suggestions from code review

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-04 18:41:20 +02:00
epenet
0fb1fbf0d1 Improve config flow type hints (q-s) (#125198)
* Improve config flow type hints (q-s)

* Revert screenlogic

* Revert starline
2024-09-04 18:38:34 +02:00
epenet
643fd34478 Improve config flow type hints in starline (#125202) 2024-09-04 18:38:19 +02:00
Duco Sebel
186c9aa33b Remove ExternalDevice migration in HomeWizard (#125197) 2024-09-04 18:32:57 +02:00
Martins Sipenko
af51241c0d Reenable Smarty integration (#124148)
* Reenable Smarty integration

* Updated codeowners to myself

* Revert "Updated codeowners to myself"

This reverts commit 639fef32b9.

* Upgraded pysmarty2 to version 0.10.1 which is not pinned to specific pymodbus version

* Update requirements_all.txt
2024-09-04 18:01:49 +02:00
Shay Levy
eaee8d5b78 Fix BTHome validate triggers for device with multiple buttons (#125183)
* Fix BTHome validate triggers for device with multiple buttons

* Remove None default
2024-09-04 17:34:11 +02:00
Michael Hansen
638434c103 Bump intents to 2024.9.4 (#125232) 2024-09-04 17:36:25 +03:00
Marc Mueller
3a44098ddf Fix Path.__enter__ DeprecationWarning in tests (#125227) 2024-09-04 07:12:57 -07:00
LG-ThinQ-Integration
1e1c3506fe Bump thinqconnect to 0.9.6 (#125155)
* Refactor LG ThinQ integration

* Rename ha_bridge_list to bridge_list

* Update for reviews

* Correct spells
Do not use mqtt related api

* Guarantee update status

* Update for reviews

* Update reviews

---------

Co-authored-by: jangwon.lee <jangwon.lee@lge.com>
2024-09-04 15:52:41 +02:00
Iskra kranj
b557e9e826 Add Iskra integration (#121488)
* Add iskra integration

* iskra non resettable counters naming fix

* added iskra config_flow test

* fixed iskra integration according to code review

* changed iskra config flow test

* iskra integration, fixed codeowners

* Removed counters code & minor fixes

* added comment

* Update homeassistant/components/iskra/__init__.py

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

* Updated Iskra integration according to review

* Update homeassistant/components/iskra/strings.json

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

* Updated iskra integration according to review

* minor iskra integration change

* iskra integration changes according to review

* iskra integration changes according to review

* Changed iskra integration according to review

* added iskra config_flow range validation

* Fixed tests for iskra integration

* Update homeassistant/components/iskra/coordinator.py

* Update homeassistant/components/iskra/config_flow.py

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

* Fixed iskra integration according to review

* Changed voluptuous schema for iskra integration and added data_descriptions

* Iskra integration tests lint error fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-04 15:33:23 +02:00
Denis Shulyaka
da0d1b71ce Update Anthropic default model to Haiku (#125225) 2024-09-04 06:30:28 -07:00
Robert Resch
4d96ed4c68 Update modified_at datetime on storage collection changes (#125218) 2024-09-04 15:05:51 +02:00
Marc Mueller
1bc63a61be Fix enum lookup (#125220) 2024-09-04 15:05:28 +02:00
Michal Jál
5c35ccb9ca Allow Switchbot users to force nightlatch (#124326)
* Add option to force nightlatch operation mode

* Fix format

* Make the new option available only for lock pro entry

* use senor_type instead of switchbot model + tests

* Update homeassistant/components/switchbot/lock.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-04 15:03:59 +02:00
J. Nick Koston
a1ecefee21 Bump aioesphomeapi to 25.3.2 (#125188)
changelog: https://github.com/esphome/aioesphomeapi/compare/v25.3.1...v25.3.2
2024-09-04 08:35:52 -04:00
Hessel
b5d7eba4f6 Add new number component for setting the wallbox ICP current (#125209)
* Add new number component for setting the wallbox ICP current

* feat: Add number component for wallbox ICP current control
2024-09-04 14:00:38 +02:00
starkillerOG
4b111008df Add 100% coverage of Reolink button platform (#124380)
* Add 100% button coverage

* review comments

* fix

* Use SERVICE_PRESS constant

* Use DOMAIN instead of const.DOMAIN

* styling

* User entity_registry_enabled_by_default fixture

* fixes

* Split out ptz_move test

* use SERVICE_PTZ_MOVE constant
2024-09-04 12:16:57 +02:00
Lenn
fb5afff9d5 Add Motionblinds Bluetooth diagnostics (#121899)
* Add diagnostics platform

* Add diagnostics test

* Remove comments

* Exclude created_at and modified_at from snapshot

* Fix entry_id in mock_config_entry

* Add repr to excluded props from snapshot

* Improve diagnostics

* Use function name instead of number for callback diagnostics

* Remove info from diagnostics

* Reformat
2024-09-04 12:11:11 +02:00
Robert Resch
38a1c97a51 Bump deebot-client to 8.4.0 (#125207) 2024-09-04 11:46:41 +02:00
J. Nick Koston
b26e4d672f Bump yarl to 1.9.8 (#125193)
changelog: https://github.com/aio-libs/yarl/compare/v1.9.7...v1.9.8
2024-09-04 11:44:49 +02:00
Bram Kragten
daa5268cf2 Update frontend to 20240904.0 (#125206) 2024-09-04 11:35:14 +02:00
Matthias Alphart
9da3f98c23 Update knx-frontend to 2024.9.4.64538 (#125196) 2024-09-04 11:00:02 +02:00
Erik Montnemery
8fd691be69 Teach recorder data migrator base class to remove index (#125168)
* Teach recorder data migrator base class to remove index

* Fix tests
2024-09-04 09:52:41 +02:00
Erik Montnemery
7fc0e36b2f Move recorder EntityIDPostMigrationTask to migration (#125136)
* Move recorder EntityIDPostMigrationTask to migration

* Update test
2024-09-04 08:38:46 +02:00
Erik Montnemery
482bed522f Fix missing patch in nextdns tests (#125195) 2024-09-04 08:34:51 +02:00
Raman Gupta
7788685340 Get zwave_js statistics data from model (#120281)
* Get zwave_js statistics data from model

* Add migration logic

* Update comment

* revert change to forward entry
2024-09-04 08:16:56 +02:00
Dian
af1af6f391 Bump xiaomi-ble to 0.31.1 to add support for human presence sensor XMOSB01XS (#124751) 2024-09-03 20:11:32 -10:00
Shay Levy
d5c2e6ec35 Add myself as codeowner for BTHome (#125184) 2024-09-04 00:20:25 +03:00
Erik Montnemery
d8382c6de2 Improve recorder tests to check indices are removed (#125164) 2024-09-03 22:56:27 +02:00
starkillerOG
c4cfff4b3f Add 100% coverage of Reolink update platform (#124521)
* Add 100% update test coverage

* Add assertion
2024-09-03 22:50:00 +02:00
G Johansson
cfe0c95c97 Bump python-holidays to 0.56 (#125182) 2024-09-03 22:43:03 +02:00
Maciej Bieniek
50c1bf8bb0 Add re-auth flow to NextDNS integration (#125101) 2024-09-03 22:38:07 +02:00
Erik Montnemery
cc3d059783 Refactor recorder EventIDPostMigration data migrator (#125126) 2024-09-03 22:37:50 +02:00
Joakim Sørensen
4aa86a574f Add include-hidden-files to upload env_file artifact (#125179) 2024-09-03 22:23:26 +02:00
J. Nick Koston
3a8039cbc0 Bump yalexs to 8.6.3 (#125176)
Fixes the battery state not refreshing due to a refactoring
error in the library.

changelog: https://github.com/bdraco/yalexs/compare/v8.6.2...v8.6.3
2024-09-03 22:18:19 +02:00
Joakim Plate
e4f9f6447f Update gardena_bluetooth dependency to 1.4.3 (#125175) 2024-09-03 21:45:43 +02:00
mvn23
14482ff6da Update opentherm_gw tests to prepare for new platforms (#125172)
Move MockConfigEntry to a fixture
2024-09-03 21:18:38 +02:00
Hans Kröner
be8f14167f Expose UV Index in Met.no (#124992)
UV Index now also appears in forecasts.
2024-09-03 21:00:44 +02:00
J. Nick Koston
27032c1780 Bump yalexs to 8.6.2 (#125162)
changelog: https://github.com/bdraco/yalexs/compare/v8.6.0...v8.6.2
2024-09-03 19:53:10 +02:00
Paul Bottein
61a722218a Update frontend to 20240903.1 (#125160) 2024-09-03 19:52:38 +02:00
Raj Laud
3137c27e56 Fix type errors in squeezebox (#125166) 2024-09-03 19:50:44 +02:00
Nerdix
7b35c3036e Enhance error handling when changing a timer's duration (#121786)
* Update remaining before checking duration

* fix comment

* calculation based on transient field

* lint

* remove useless brackets
2024-09-03 19:47:00 +02:00
mvn23
8e03f3a045 Update opentherm_gw tests to avoid patching internals (#125152)
* Update tests to avoid patching internals

* * Use fixtures for tests
* Update variable names in tests for clarity

* Use hass.config_entries.async_setup instead of setup.async_setup_component
2024-09-03 19:19:43 +02:00
Raj Laud
8f26cff65a Enable strict typing for the Squeezebox integration (#125161)
* Strict typing for squeezebox

* Improve unit tests

* Refactor tests to use websockets and services.async_call

* Apply suggestions from code review

* Fix merge conflict
2024-09-03 19:19:30 +02:00
Alex Wijnholds
00533bae4b Add support for total YouTube views (#123144)
* Add support for retrieving the total views of a channel.

* Add missing tests

* Re-order imports

* Another run on code format

* Add missing translation

* Update YouTube test snapshots
2024-09-03 17:44:20 +02:00
Alexandre CUER
8255728f53 Migrate emoncms to config flow (#121336)
* Migrate emoncms to config flow

* tests coverage 98%

* use runtime_data

* Remove pyemoncms bump.

* Remove not needed yaml parameters add async_update_data to coordinator

* Reduce snapshot size

* Remove CONF_UNIT_OF_MEASUREMENT

* correct path in emoncms_client mock

* Remove init connexion check
as done by config_entry_first_refresh
since async_update_data catches exceptionand raise UpdateFailed

* Remove CONF_EXCLUDE_FEEDID from config flow

* Update homeassistant/components/emoncms/__init__.py

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

* Update homeassistant/components/emoncms/sensor.py

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

* Update homeassistant/components/emoncms/strings.json

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

* Use options in options flow and common strings

* Extend the ConfigEntry type

* Define the type explicitely

* Add data description in strings.json

* Update tests/components/emoncms/test_config_flow.py

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

* Update tests/components/emoncms/test_config_flow.py

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

* Add test import same yaml conf + corrections

* Add test user flow

* Use data_description...

* Use snapshot_platform in test_sensor

* Transfer all fixtures in conftest

* Add async_step_choose_feeds to ask flows to user

* Test abortion reason in test_flow_import_failure

* Add issue when value_template is i yaml conf

* make text more expressive in strings.json

* Add issue when no feed imported during migration.

* Update tests/components/emoncms/test_config_flow.py

* Update tests/components/emoncms/test_config_flow.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-03 17:21:13 +02:00
ollo69
470335e27a Add sensors for AsusWRT using http(s) library (#124337)
* Additional sensors for AsusWRT using http(s) library

* Remove temperature sensors refactor from PR

* Fix test function name

* Change translation a suggested

* Requested changes
2024-09-03 17:11:17 +02:00
Andrew Jackson
56887747a6 Bump aiomealie to 0.9.2 (#125153)
Bump mealie version
2024-09-03 17:09:26 +02:00
Erik Montnemery
1dcae0c0a6 Improve some comments in recorder tests (#125118) 2024-09-03 17:04:08 +02:00
Erik Montnemery
8759a6a14d Make optional arguments to frame.report kwarg only (#125062)
* Make optional arguments to frame.report kwarg only

* Update homeassistant/helpers/frame.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-09-03 17:03:36 +02:00
Hans Kröner
5d072d1030 Bump PyMetno to 0.13.0 (#125151) 2024-09-03 16:51:13 +02:00
Raj Laud
78517f75e8 Add favorites support to Media Browser for Squeezebox integration (#124732)
* Add Favorites support to Media Browser

* CI fixes

* More CI Fixes

* Another CI

* Change icons for other library items to use standard LMS icons

* Change max favorites to BROWSE_LIMIT

* Simplify library_payload to consolidate favorite and non-favorite items

* Simplify library_payload to consolidate favorite and non-favorite items

* Add support for favorite hierarchy

* small fix for icon naming with local albums

* Add ability to expand an album from a favorite list

* Reformat to fix linting error

* and ruff format

* Use library calls from pysqueezebox

* Folder and playback support

* Bump to pysqueezebox 0.8.0

* Bump pysqueezebox version to 0.8.1

* Add unit tests

* Improve unit tests

* Refactor tests to use websockets and services.async_call

* Apply suggestions from code review

---------

Co-authored-by: peteS-UK <64092177+peteS-UK@users.noreply.github.com>
2024-09-03 16:50:55 +02:00
MJJ
42ed7fbb0d Increase timeout for fetching buienradar weather data (#124597)
Increase timeout for fetching weather data
2024-09-03 16:50:30 +02:00
Michael
96be3e2505 Use SnapshotAssertion in more AVM Fritz!Box Tools tests (#125037)
use SnapshotAssertion in more tests
2024-09-03 16:39:06 +02:00
UltimateGG
2fa3b9070c Fix updating insteon modem configuration while disconnected (#121918)
#121917 Fix updating insteon modem configuration while disconnected
2024-09-03 16:31:48 +02:00
mvn23
d827c53a85 Remove opentherm_gw options migration (#125046) 2024-09-03 15:59:12 +02:00
G Johansson
436ac72b82 End deprecation setting attributes directly on config entry (#123729)
* End deprecation setting attr directly on config entry

* Update ollama test

* Fix android_tv
2024-09-03 15:56:00 +02:00
Martin Hjelmare
7c15075231 Clean up Z-wave error log when raising in service handlers (#125138) 2024-09-03 15:49:11 +02:00
S
8e3ad2d1f3 Extended epson projector integration to include serial connections (#121630)
* Extended epson projector integration to include serial connections

* Fix review changes

* Improve epson types and translations

* Fix comment

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
2024-09-03 15:46:57 +02:00
dependabot[bot]
733bbf9cd1 Bump actions/upload-artifact from 4.3.6 to 4.4.0 (#125056)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.6 to 4.4.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.3.6...v4.4.0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-03 15:46:05 +02:00
Jakob Schlyter
822660732b Support setting Amazon Polly engine in service call (#120226) 2024-09-03 15:45:37 +02:00
Erik Montnemery
d6bd4312ab Add explaining comments in cv.template tests (#125081) 2024-09-03 15:34:31 +02:00
J. Nick Koston
491bde181c Speed up hassio send_command url check (#125122)
* Speed up hassio send_command url check

The send_command call checked the resulting path to make
sure that the input path was not modified when converting
to a URL. Since the host is is pre-set, we only need to check
the processed raw_path matches command instead of converting
back to a string, and than comparing it against another
constructed string.

* Speed up hassio send_command url check

The send_command call checked the resulting path to make
sure that the input path was not modified when converting
to a URL. Since the host is is pre-set, we only need to check
the processed raw_path matches command instead of converting
back to a string, and than comparing it against another
constructed string.

* adjust
2024-09-03 15:29:02 +02:00
Artur Pragacz
fdce524811 Add Onkyo Receiver class to improve typing (#124190) 2024-09-03 15:27:33 +02:00
Erik Montnemery
cf10549df4 Restore unnecessary assignment of Template.hass in event helper (#125143) 2024-09-03 15:25:35 +02:00
Marcel van der Veldt
fd01e22ca4 Fix energy sensor for ThirdReality Matter powerplug (#125140) 2024-09-03 15:24:49 +02:00
tronikos
334359bb0a Add Google Cloud Speech-to-Text (STT) (#120854)
* Google Cloud

* .

* fix

* mypy

* add tests

* Update .coveragerc

* Update const.py

* upload file, reconfigure and import flow

* fixes

* default to latest_short

* mypy

* update

* Allow clearing options in the UI

* update

* update

* update
2024-09-03 15:23:07 +02:00
Steven B.
eda1656e75 Abort ring config_flow if account is already configured (#125120)
* Abort ring config_flow if account is already configured

* Update tests/components/ring/test_config_flow.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-03 15:22:38 +02:00
Robert Resch
6cea6be4a7 Improve hassfest docker image (#125133)
* Improve hassfest docker image

* Use fixed uv version

* Use cli params instead env

* run hassfest

* Exclude pycache
2024-09-03 14:59:01 +02:00
Brett Adams
6ecc5c19a2 Add climate platform to Tesla Fleet (#123169)
* Add climate

* docstring

* Add tests

* Fix limited scope situation

* Add another test

* Add icons

* Type vehicle data

* Replace inline temperatures

* Fix handle_vehicle_command type

* Fix preset turning HVAC off

* Fix cop_mode check

* Use constants

* Reference docs in command signing error

* Move to a read-only check

* Remove raise_for

* Fixes

* Tests

* Remove raise_for_signing

* Remove unused strings

* Fix async_set_temperature

* Correct tests

* Remove HVAC modes at startup in read-only mode

* Fix order of init actions to set hvac_modes correctly

* Fix no temp test

* Add handle command type

* Docstrings

* fix matches and fix a bug

* Split tests

* Fix issues from rebase
2024-09-03 14:38:47 +02:00
Erik Montnemery
c321bd70e1 Log deprecation warning when cv.template is called from wrong thread (#125141)
Log deprecation warning when cv.template is called from wrong thread
2024-09-03 14:37:21 +02:00
Erik Montnemery
851600630c Log deprecation warning when template.Template is created without hass (#125142)
* Log deprecation warning when template.Template is created without hass

* Improve docstring
2024-09-03 14:28:33 +02:00
Michal Jál
e3896d1f60 Bump PySwitchbot to 0.48.2 (#125113) 2024-09-03 14:22:39 +02:00
Aaron Bach
c71cf272c8 Fix unhandled exception with missing IQVIA data (#125114) 2024-09-03 14:21:52 +02:00
Robert Resch
d12c6f89d2 Bump hadolint to 2.12.0 and use matrix for all Dockerfiles (#125131)
* Bump hadolint to 2.12.0 and use matrix for all Dockerfiles

* Fix

* Disable fail fast
2024-09-03 14:13:43 +02:00
Steven B.
5965d8d503 Pass hass clientsession to ring config flow (#125119)
Pass hass clientsession to ring config flow
2024-09-03 14:00:30 +02:00
ilan
94f458ff98 Bump py-madvr2 to 1.6.32 (#125049)
feat: update lib
2024-09-03 13:56:59 +02:00
Allen Porter
c07a9e9d59 Add dependency on google-photos-library-api: Change the Google Photos client library to a new external package (#125040)
* Change the Google Photos client library to a new external package

* Remove mime type guessing

* Update tests to mock out the client library and iterators

* Update homeassistant/components/google_photos/media_source.py

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

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-03 13:54:43 +02:00
Philip Vanloo
b9db9eeab2 Add Linkplay mTLS/HTTPS and improve logging (#124307)
* Work

* Implement 0.0.8 changes, fixup tests

* Cleanup

* Implement new playmodes, close clientsession upon ha close

* Implement new playmodes, close clientsession upon ha close

* Add test for zeroconf bridge failure

* Bump 0.0.9
Address old comments in 113940

* Exact _async_register_default_clientsession_shutdown
2024-09-03 13:34:47 +02:00
Christopher Fenner
f34b449f61 Correct device serial for ViCare integration (#125125)
* expose correct serial

* adapt inits

* adjust _build_entities

* adapt inits

* add serial data point

* update snapshot

* apply suggestions

* apply suggestions
2024-09-03 12:50:05 +02:00
Artur Pragacz
fc24843274 Fix Onkyo action select_hdmi_output (#125115)
* Fix Onkyo service select_hdmi_output

* Move Hasskey directly under Onkyo domain
2024-09-03 12:43:31 +02:00
Steven B.
22b6239304 Convert ring integration to use entry.runtime_data (#125127) 2024-09-03 12:04:35 +02:00
LG-ThinQ-Integration
aa8fe99113 Add binary_sensor platform to LG Thinq (#125054)
* Add binary_sensor entity

* Update the document link due to the domain name change

* Update casing

---------

Co-authored-by: jangwon.lee <jangwon.lee@lge.com>
2024-09-03 09:30:46 +02:00
Erik Montnemery
7c223db1d5 Remove recorder PostSchemaMigrationTask (#125076)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-03 07:51:27 +02:00
Jan Bouwhuis
0c18b2e7ff Remove is_on function from homeassistant.components (#125104)
* Remove `is_on` method from `homeassistant.components`

* Cleanup test
2024-09-03 06:57:25 +02:00
dontinelli
d68ee8dcea Replace _host_in_configuration_exists with async_abort_entries_match in solarlog (#125099)
* Add diagnostics to solarlog

* Fix wrong comment

* Move to async_abort_entries_match

* Remove obsolete method solarlog_entries

* Update tests/components/solarlog/test_config_flow.py

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

* Update tests/components/solarlog/test_config_flow.py

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

* Update tests/components/solarlog/test_config_flow.py

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

* Update tests/components/solarlog/test_config_flow.py

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

* Amend import of config_entries.SOURCE_USER

* Update tests/components/solarlog/test_config_flow.py

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

* Ruff

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-03 00:38:09 +02:00
cnico
671aaa7e95 Bump flipr api to 1.6.1 (#125106) 2024-09-02 23:51:10 +02:00
Álvaro Fernández Rojas
faefe624f6 Add Airzone Cloud Aidoo HVAC indoor/outdoor sensors (#125013)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-09-02 22:17:24 +02:00
J. Nick Koston
f93259a2f1 Bump yalexs to 8.6.0 (#125102) 2024-09-02 21:43:34 +02:00
Erik Montnemery
606524f9e7 Test string timestamps are wiped after migration to schema version 32 (#125091)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-02 21:33:35 +02:00
J. Nick Koston
cd89db9bb6 Add coverage for late unifiprotect person detection events (#125103) 2024-09-02 09:26:02 -10:00
Richard Kroegel
f760c13e8f Fix blocking calls for OpenAI conversation (#125010) 2024-09-02 09:23:38 -10:00
Martin Hjelmare
687cd32142 Handle telegram polling errors (#124327) 2024-09-02 09:23:24 -10:00
Artur Pragacz
fb27297df9 Fix area registry indexing when there is a name collision (#125050) 2024-09-02 09:23:07 -10:00
Avi Miller
3e350bdc90 Bump aiolifx to 1.0.9 and remove unused HomeKit model prefixes (#125055)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-02 09:22:39 -10:00
Erik Montnemery
0b14f0a379 Add test of statistics timestamp migration (#125100) 2024-09-02 09:13:26 -10:00
Maciej Bieniek
3206979488 Add separate entities for temperature, humidity and pressure in AccuWeather integration (#125041)
* Add temperature, humidity and pressure sensors

* Make uv index sensor disabled by default

* Fix type
2024-09-02 20:46:32 +02:00
Jan Bouwhuis
4c27bfbf7f Cleanup removed options for mqtt climate (#125083) 2024-09-02 20:35:36 +02:00
dontinelli
7c4fd9473c Add diagnostics to solarlog (#125072)
* Add diagnostics to solarlog

* Fix wrong comment
2024-09-02 20:08:44 +02:00
Paul Bottein
633c904852 Update frontend to 20240902.0 (#125093) 2024-09-02 20:04:33 +02:00
dontinelli
5300eddf33 Remove roundig in Solarlog and add suggested_display_precision (#125094)
* Remove roundig and add suggested_display_precision

* Add suggested_unit_of_measurement

* Put lamda in parentheses
2024-09-02 19:50:09 +02:00
Erik Montnemery
9f558d13e6 Correct start version in recorder schema migration tests (#125090)
* Correct start version in recorder schema migration tests

* Remove default from states.last_updated_ts
2024-09-02 19:32:01 +02:00
Steven B.
9ae59e5ea0 Bump ring-doorbell to 0.9.3 (#125087) 2024-09-02 18:18:45 +02:00
Steven B.
1b1c1c2a55 Call async_write_ha_state after ring update (#125096)
Use async_write_ha_state after ring update
2024-09-02 18:03:58 +02:00
Erik Montnemery
df4bd721b5 Deprecate template.attach (#124843) 2024-09-02 15:33:10 +02:00
Erik Montnemery
baa876d4d9 Remove lying comment from service.async_register_entity_service (#125079) 2024-09-02 15:18:02 +02:00
LG-ThinQ-Integration
b99dceab74 Do not LG thinq retry entry setup, when a single coordinator failed (#125052)
Do not retry entry setup, when a single coordinator failed.

Co-authored-by: jangwon.lee <jangwon.lee@lge.com>
2024-09-02 14:58:06 +02:00
Erik Montnemery
114e254aa6 Don't raise when registering entity service with invalid schema (#125057)
* Don't raise when registering entity service with invalid schema

* Update homeassistant/helpers/service.py

Co-authored-by: Robert Resch <robert@resch.dev>

---------

Co-authored-by: Robert Resch <robert@resch.dev>
2024-09-02 14:20:50 +02:00
Erik Montnemery
fbfd8c48aa Remove unused event from recorder (#125067) 2024-09-02 13:33:51 +02:00
tronikos
d40e3145fe Setup Google Cloud from the UI (#121502)
* Google Cloud can now be setup from the UI

* mypy

* Add BaseGoogleCloudProvider

* Allow clearing options in the UI

* Address feedback

* Don't translate Google Cloud title

* mypy

* Revert strict typing changes

* Address comments
2024-09-02 04:30:18 -07:00
tronikos
f4a16c8dc9 Add strict typing in Google Cloud (#125068) 2024-09-02 04:07:12 -07:00
Nidre
2ce6bd2378 Update Matter light transition blocklist to include YNDX LightStrip (#124657) 2024-09-02 12:28:49 +02:00
J. Nick Koston
9334099bed Bump habluetooth to 3.4.0 (#125058)
changelog: https://github.com/Bluetooth-Devices/habluetooth/compare/v3.3.2...v3.4.0
2024-09-02 11:28:42 +02:00
dontinelli
077edb08f6 Bump fyta_cli to 0.6.6 (#125065) 2024-09-02 11:27:31 +02:00
epenet
72d5146a3e Improve renault tests (#125064) 2024-09-02 10:46:35 +02:00
tronikos
fa14321aa1 Bump androidtvremote2 to 0.1.2 to fix blocking event loop when loading ssl certificate chain (#125061)
Bump androidtvremote2 to 0.1.2
2024-09-02 01:41:29 -07:00
Erik Montnemery
8f679fcbf3 Fix motionblinds_ble tests (#125060) 2024-09-02 09:51:05 +02:00
G Johansson
78cf7dc873 New template merge_response (#114204)
* New template merge_response

* Extending

* Extend comment

* Update

* Fixes

* Fix comments

* Mods

* snapshots

* Fixes from discussion
2024-09-02 08:13:10 +02:00
Allen Porter
9fff3a13a5 Clarify comment in google photos upload service (#125042) 2024-09-01 21:49:38 -07:00
Shay Levy
99f43400bf Bump aioshelly to 11.4.2 (#125036) 2024-09-01 11:08:19 -10:00
J. Nick Koston
77b464f2bd Bump yarl to 1.9.7 (#125035) 2024-09-01 10:47:24 -10:00
Michael
07e251d488 Add diagnostics platform to modern forms (#125032) 2024-09-01 22:04:29 +02:00
dontinelli
659d135fca Add ConductivityConverter in websocket_api.py (#125029) 2024-09-01 21:02:32 +02:00
Álvaro Fernández Rojas
24414369d7 Update aioairzone-cloud to v0.6.5 (#125030)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-09-01 21:28:13 +03:00
Etienne Soufflet
92c1fb77e9 Fix Tado fan speed for AC (#122415)
* change capabilities

* fix tests 2

* improve usability with capabilities

* fix swings management

* Update homeassistant/components/tado/climate.py

Co-authored-by: Erwin Douna <e.douna@gmail.com>

* fix after Erwin's review

* fix after joostlek's review

* use constant

* use in instead of get

---------

Co-authored-by: Erwin Douna <e.douna@gmail.com>
2024-09-01 18:33:45 +02:00
Martin Hjelmare
ae1f53775f Bump python-telegram-bot to 21.5 (#125025) 2024-09-01 17:51:31 +02:00
Dmitry Krasnoukhov
bd6b5568eb Extend hjjcy device category in Tuya integration (#124854)
* Extend hjjcy device category in Tuya integration

* Better AQI level names
2024-09-01 17:50:53 +02:00
Malte Franken
5f2964d3e8 Bump aio-georss-gdacs to 0.10 (#125021)
bump aio-georss-gdacs to 0.10
2024-09-01 17:38:48 +02:00
Joost Lekkerkerker
c6865d0862 Bump aiomealie to 0.9.1 (#125017) 2024-09-01 17:37:06 +02:00
Richard Kroegel
ef8fc3913e Fix ollama blocking on load_default_certs (#125012)
* Fix ollama blocking on load_default_certs

* Use get_default_context instead of client_context
2024-09-01 17:35:55 +02:00
mvn23
56667ec2bc Migrate opentherm_gw climate entity unique_id (#125024)
* Migrate climate entity unique_id to match the format used by other opentherm_gw entities
* Add test to verify migration
2024-09-01 17:22:03 +02:00
Richard Kroegel
fa21613951 Fix telegram_bot blocking on load_default_certs (#125014)
* Fix telegram_bot blocking on load_default_certs

* Use sync variant of create_issue
2024-09-01 17:13:04 +02:00
Richard Kroegel
f735d12a66 Fix BMW client blocking on load_default_certs (#125015)
* Fix BMW client blocking load_default_certs

* Use get_default_context
2024-09-01 16:26:14 +02:00
mvn23
2f7a396778 Split opentherm_gw entities between different devices (#124869)
* * Add migration from single device to multiple devices, removing all old entities
* Create new devices for Boiler and Thermostat
* Add classes for new entities based on the new devices

* Split binary_sensor entities into devices

* Split sensor entities into different devices

* Move climate entity to thermostat device

* Fix climate entity away mode

* Fix translation placeholders

* Allow sensor values with capital letters

* * Add EntityCategory
* Update and add device_classes

* Fix translation keys

* Fix climate entity category

* Update tests

* Handle `available` property in `entity.py`

* Improve GPIO state binary_sensor translations

* Fix: Updates are already subscribed to in the base entity

* Remove entity_id generation from sensor and binary_sensor entities

* * Use _attr_name on climate class instead of through entity_description
* Add type hints

* Rewrite to derive entities for all OpenTherm devices from a single base class

* Improve type annotations

* Use OpenThermDataSource to access status dict

* Move entity_category from entity_description to _attr_entity_category

* Move entity descriptions with the same translation_key closer together

* Update tests

* Add device migration test

* * Add missing sensors and binary_sensors back
* Improve migration, do not delete old entities from registry

* Add comments for migration period

* Use single lists for entity descriptions

* Avoid changing sensor values, remove translations

* * Import only required class from pyotgw
* Update tests
2024-09-01 13:28:08 +02:00
Jeef
12336f5c15 Bump Intellifire to 4.1.9 (#121091)
* rebase

* Minor patch to fix duplicate DeviceInfo beign created - if data hasnt updated yet

* rebase

* Minor patch to fix duplicate DeviceInfo beign created - if data hasnt updated yet

* fixing formatting

* Update homeassistant/components/intellifire/__init__.py

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

* Update homeassistant/components/intellifire/__init__.py

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

* Removing cloud connectivity sensor - leaving local one in

* Renaming class to something more useful

* addressing pr

* Update homeassistant/components/intellifire/__init__.py

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

* add ruff exception

* Fix test annotations

* remove access to private variable

* Bumping to 4.1.9 instead of 4.1.5

* A renaming

* rename

* Updated testing

* Update __init__.py

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

* updateing styrings

* Update tests/components/intellifire/conftest.py

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

* Testing refactor - WIP

* everything is passing - cleanup still needed

* cleaning up comments

* update pr

* unrename

* Update homeassistant/components/intellifire/coordinator.py

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

* fixing sentence

* fixed fixture and removed error codes

* reverted a bad change

* fixing strings.json

* revert renaming

* fix

* typing inother pr

* adding extra tests - one has a really dumb name

* using a real value

* added a migration in

* Update homeassistant/components/intellifire/config_flow.py

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

* Update tests/components/intellifire/test_init.py

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

* cleanup continues

* addressing pr

* switch back to debug

* Update tests/components/intellifire/conftest.py

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

* some changes

* restore property mock cuase didnt work otherwise

* cleanup has begun

* removed extra text

* addressing pr stuff

* fixed reauth

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-01 12:48:38 +02:00
dontinelli
1661304f10 Bump solarlog_cli to 0.2.2 (#124948)
* Add inverter-devices

* Minor code adjustments

* Update manifest.json

Seperate dependency upgrade to seperate PR

* Update requirements_all.txt

Seperate dependency upgrade to seperate PR

* Update requirements_test_all.txt

Seperate dependency upgrade to seperate PR

* Update homeassistant/components/solarlog/sensor.py

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

* Split up base class, document SolarLogSensorEntityDescription

* Split up sensor types

* Update snapshot

* Bump solarlog_cli to 0.2.1

* Add strict typing

* Bump fyta_cli to 0.6.3 (#124574)

* Ensure write access to hassrelease data folder (#124573)

Co-authored-by: Robert Resch <robert@resch.dev>

* Update a roborock blocking call to be fully async (#124266)

Remove a blocking call in roborock

* Add inverter-devices

* Split up sensor types

* Update snapshot

* Bump solarlog_cli to 0.2.1

* Backport/rebase

* Tidy up

* Simplyfication coordinator.py

* Minor adjustments

* Ruff

* Bump solarlog_cli to 0.2.2

* Update homeassistant/components/solarlog/sensor.py

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

* Update homeassistant/components/solarlog/config_flow.py

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

* Update homeassistant/components/solarlog/sensor.py

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

* Update persentage-values in fixture

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Allen Porter <allen@thebends.org>
2024-09-01 12:47:52 +02:00
Álvaro Fernández Rojas
68162e1a27 Update aioairzone-cloud to v0.6.4 (#125007)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-09-01 12:45:59 +02:00
Bill Flood
95a25c72dc Use constant for default medium type in Mopeka (#125002)
- Updated the Mopeka BLE device setup to use const
  DEFAULT_MEDIUM_TYPE
- Fix Spelling error in a coment
2024-09-01 07:12:24 +02:00
Allen Porter
30772da0e1 Add Google Photos media source support for albums and favorites (#124985) 2024-08-31 14:39:18 -07:00
Allen Porter
ef84a8869e Add Google Photos service for uploading content (#124956)
* Add Google Photos upload support

* Fix format

* Merge in scope/reauth changes

* Address PR feedback

* Fix blocking i/o in async
2024-08-31 21:16:14 +02:00
Allen Porter
d3879a36d1 Add loggers for Google Photos integration (#124986) 2024-08-31 21:11:22 +02:00
Allen Porter
93afc9458a Update nest to only include the image attachment payload for cameras that support fetching media (#124590)
Only include the image attachment payload for cameras that support fetching media
2024-08-31 11:38:45 -07:00
Marc Mueller
5cd8e4ab7e Update mypy-dev to 1.12.0a3 (#124939)
* Update mypy-dev to 1.12.0a3

* Fix
2024-08-31 19:34:41 +02:00
Álvaro Fernández Rojas
994c2ebca1 Update aioairzone-cloud to v0.6.3 (#124978)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-08-31 17:30:58 +02:00
Allen Porter
81f5068354 Clean up Google Photos media source (#124977)
* Clean up Google Photos media source

* Fix typo

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-08-31 08:22:50 -07:00
Brett Adams
3e60d7aa11 Small code quality fix in Teslemetry (#124603)
* Fix cop_mode logic bug

* Update climate.py

* Fix attributes
2024-08-31 07:41:00 -07:00
Joost Lekkerkerker
30aa3a26ad Merge coordinators in Airgradient (#124714) 2024-08-31 07:40:12 -07:00
epenet
9da5dd0090 Improve config flow type hints in cast (#124861) 2024-08-31 07:38:06 -07:00
Brett Adams
65f007ace7 Remove HVAC Modes when no scopes in Teslemetry (#124612)
* Remove modes when not scoped

* Fix inits

* Re-add raise

* Remove unused raise_for_scope

* Set hvac_modes when not scoped

* tests
2024-08-31 07:28:35 -07:00
Joost Lekkerkerker
2a8feda691 Define household support in Mealie (#124950) 2024-08-31 12:00:12 +02:00
Andre Lengwenus
36b7e8569e Send entity name or original name to LCN frontend (#124518)
* Send name or original name to frontend

* Use walrus operator

* Fix docstring

* Fix mutated config_entry.data
2024-08-31 11:42:22 +02:00
Alan Murray
221f961574 Bump aiopulse to 0.4.6 (#124964)
Non-breaking changes to fix isses:
 * eliminating hub exceptions raised due use of unicode strings.
 * eliminating hub exceptions raised due to Timers being configured on hub.
2024-08-31 11:33:58 +02:00
J. Nick Koston
7210cc1da6 Bump yarl to 1.9.6 (#124955)
* Bump yarl to 1.9.5

changelog: https://github.com/aio-libs/yarl/compare/v1.9.4...v1.9.5

* remove default port since mocker does exact matching and yarl now normalizes this

* 1.9.6
2024-08-31 11:03:08 +02:00
vhkristof
5fa23b1785 Bump renault-api to v0.2.7 (#124858)
* Bump renault-api to v0.2.7

* Updated requirements_all and requirements_test_all
2024-08-31 10:56:23 +02:00
Allen Porter
2cab9f7fe9 Address additional Google Photos integration feedback (#124957)
* Address review feedback

* Fix typing for  arguments
2024-08-31 10:10:45 +02:00
J. Nick Koston
3bfcb1ebdd Restore sisyphus integration (#124749)
* Revert "Disable sisyphus integration (#124742)"

This reverts commit 1b304e60d9.

* Restore sisyphus integration

reverts #124742 and updates the lib instead

changelog: https://github.com/jkeljo/sisyphus-control/compare/v3.1.3...v3.1.4

release is pending: https://github.com/jkeljo/sisyphus-control/pull/8#issuecomment-2313893689
2024-08-31 10:07:36 +02:00
Allen Porter
c1eb5f8b74 Fix Google Photos get media calls (#124958) 2024-08-31 10:01:51 +02:00
Allen Porter
582b7eab66 Add missing translation for Google Photos reauth (#124959) 2024-08-31 10:01:27 +02:00
Alex Yao
26281662b5 Enable config flow for html5 (#112806)
* html5: Enable config flow

* Add tests

* attempt check create_issue

* replace len with call_count

* fix config flow tests

* test user config

* more tests

* remove whitespace

* Update homeassistant/components/html5/issues.py

Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>

* Update homeassistant/components/html5/issues.py

Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>

* fix config

* Adjust issues log

* lint

* lint

* rename create issue

* fix typing

* update codeowners

* fix test

* fix tests

* Update issues.py

* Update tests/components/html5/test_config_flow.py

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

* Update tests/components/html5/test_config_flow.py

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

* Update tests/components/html5/test_config_flow.py

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

* update from review

* remove ternary

* fix

* fix missing service

* fix tests

* updates

* adress review comments

* fix indent

* fix

* fix format

* cleanup from review

* Restore config schema and use HA issue

* Restore config schema and use HA issue

---------

Co-authored-by: alexyao2015 <alexyao2015@users.noreply.github.com>
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Joostlek <joostlek@outlook.com>
2024-08-30 23:22:14 +02:00
Joost Lekkerkerker
ac39bf991f Rename lg_thinq domain name (#124926) 2024-08-30 22:34:34 +02:00
J. Nick Koston
0a9e20615e Limit maximum template render output to 256KiB (#124946)
* Limit maximum template render output to 256KiB

fixes #124931

256KiB is likely to still block the event loop for an unreasonable amont of
time but its likely someone is using the template engine for large
blocks of data so we want a limit which still allows that but has
a reasonable safety to prevent the system from crashing down

* Update homeassistant/helpers/template.py
2024-08-30 22:33:57 +02:00
J. Nick Koston
8cafa1bcdf Bump google-generativeai to 0.7.2 (#124940)
changelog: https://github.com/google-gemini/generative-ai-python/compare/v0.6.0...v0.7.2
2024-08-30 22:33:26 +02:00
J. Nick Koston
66ddf44399 Bump google-cloud-pubsub to 2.23.0 (#124937)
changelog: https://github.com/googleapis/python-pubsub/compare/v2.13.11...v2.23.0
2024-08-30 22:32:23 +02:00
J. Nick Koston
933ae143b3 Bump google-cloud-texttospeech to 2.17.2 (#124938)
changelog: https://github.com/googleapis/google-cloud-python/compare/google-cloud-texttospeech-v2.16.3...google-cloud-texttospeech-v2.17.2
2024-08-30 22:32:09 +02:00
Joost Lekkerkerker
8c2e63807c Make set_value required in number template (#124917)
* Make set_value required in number template

* Make set_value required in number template

* Fix tests
2024-08-30 22:02:10 +02:00
J. Nick Koston
460363c4ba Bump aioshelly to 11.4.1 to accomodate shelly GetStatus calls that take a few seconds to respond (#124893)
Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-08-30 09:05:16 -10:00
Steven B.
29a17edaa5 Exclude tplink firmware entities (#124935)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-08-30 08:56:30 -10:00
Steven B.
ed161d3d49 Bump python-kasa to 0.7.2 (#124930) 2024-08-30 08:43:28 -10:00
Louis Christ
7868ffac35 Enable strict typing checking for bluesound integration (#123821)
* Enable strict typing

* Fix types

* Update to pyblu 0.5.2 for typing support

* Update pyblu to 1.0.0

* Update pyblu to 1.0.1

* Update error handling

* Fix tests

* Remove return None from methods only returning None
2024-08-30 20:21:27 +02:00
tronikos
910fb0930e Attempt to fix IndexError in Opower (#124478)
* Change the order of async_add_external_statistics in Opower

* Use consumption_statistic_id instead of cost_statistic_id
2024-08-30 08:34:27 -07:00
Allen Porter
cb742a677c Add Google Photos reauth support (#124933)
* Add Google Photos reauth support

* Update tests/components/google_photos/test_config_flow.py

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

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-30 17:31:24 +02:00
IceBotYT
28c24e5fef Bump nice-go to 0.3.8 (#124872)
* Bump nice-go to 0.3.6

* Bump to 0.3.7

* Bump to 0.3.8
2024-08-30 17:08:58 +02:00
Mr. Bubbles
50577883dc Add option to login with username/email and password in Habitica integration (#117622)
* add login/password authentication

* add advanced config flow

* remove unused exception classes, fix errors

* update username in init

* update tests

* update strings

* combine steps with menu

* remove username from entry

* update tests

* Revert "update tests"

This reverts commit 6ac8ad6a26547b623e217db817ec4d0cf8c91f1d.

* Revert "remove username from entry"

This reverts commit d9323fb72df3f9d41be0a53bb0cbe16be718d005.

* small changes

* remove pylint broad-excep

* run habitipy init in executor

* Add text selectors

* changes
2024-08-30 17:08:06 +02:00
dontinelli
20f9b9e412 Add inverter-devices to solarlog (#123205)
* Add inverter-devices

* Minor code adjustments

* Update manifest.json

Seperate dependency upgrade to seperate PR

* Update requirements_all.txt

Seperate dependency upgrade to seperate PR

* Update requirements_test_all.txt

Seperate dependency upgrade to seperate PR

* Update homeassistant/components/solarlog/sensor.py

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

* Split up base class, document SolarLogSensorEntityDescription

* Split up sensor types

* Update snapshot

* Add all devices in config_flow

* Remove options flow

* Move devices in config_entry from options to data

* Correct mock_config_entry

* Minor adjustments

* Remove enabled_devices from config

* Remove obsolete test

* Update snapshot

* Delete obsolete code snips

* Update homeassistant/components/solarlog/sensor.py

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

* Remove obsolete test in setting up sensors

* Update homeassistant/components/solarlog/sensor.py

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

* Update homeassistant/components/solarlog/entity.py

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

* Update homeassistant/components/solarlog/config_flow.py

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

* Fix typing error

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-30 17:03:24 +02:00
Aidan Timson
1d05a917f9 Add work items per type and state counter sensors to Azure DevOps (#119737)
* Add work item data

* Add work item sensors

* Add icon

* Add test fixtures

* Add none return tests

* Apply suggestions from code review

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

* Apply suggestion

* Use icon translations

* Apply suggestions from code review

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

* Update test

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-30 16:45:46 +02:00
Joost Lekkerkerker
240bd6c3bf Bump aiomealie to 0.9.0 (#124924)
* Bump aiomealie to 0.9.0

* Bump aiomealie to 0.9.0
2024-08-30 16:41:48 +02:00
Allen Porter
c01bb44757 Add Google Photos integration (#124835)
* Add Google Photos integration

* Mark credentials typing

* Add code review suggestions to simpilfy google_photos

* Update tests/components/google_photos/conftest.py

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

* Apply suggestions from code review

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

* Fix comment typo

* Update test fixtures from review feedback

* Remove unnecessary test for services

* Remove keyword argument

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-30 07:27:19 -07:00
TimL
5e93394ae7 Ensure smilight fixtures select correct platform for tests (#124305)
* Fix return type hint for setup_integration

* Ensure platform fixture selects tested platform
2024-08-30 16:25:30 +02:00
starkillerOG
a8b55a16fd Add 100% coverage of Reolink host.py (#124577)
* Add 100% host test coverage

* Add missing test
2024-08-30 16:24:27 +02:00
LG-ThinQ-Integration
d7fb245213 Add LG ThinQ Integration (#123860)
* Add manifest.json

* add switch entity

* Add tests

* fix function's name

* adjust the changes after running scipt

* Update homeassistant/components/lgthinq/__init__.py

Accept the suggested change about format.

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

* Update homeassistant/components/lgthinq/__init__.py

Accept suggested change for log removal

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

* Delete homeassistant/components/lgthinq/services.yaml

* Update homeassistant/components/lgthinq/switch.py

Accpet suggested change for log removal

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

* Update homeassistant/components/lgthinq/strings.json

Accept suggested change for service removal

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

* Update homeassistant/components/lgthinq/manifest.json

Accept suggested change for spaces removal

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

* Delete homeassistant/components/lgthinq/icons.json

* Update __init__.py

Remove unnecessary check code

* Modification to pass ruff-format

* Modification for mypy issues

* Remove service registry and related code

* Update strings.json

Modification to pass the prettier issues

* Update manifest.json

Modification to pass the prettier issues

* Update homeassistant/components/lgthinq/__init__.py

Remove the unnecessary log.

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

* Update homeassistant/components/lgthinq/__init__.py

Remove unnecessary log.

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

* Update homeassistant/components/lgthinq/__init__.py

Remove unnecessary code.

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

* Update homeassistant/components/lgthinq/__init__.py

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

* Modifications for the review and related autocheck

* Update homeassistant/components/lgthinq/config_flow.py

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

* Update homeassistant/components/lgthinq/config_flow.py

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

* Modifications for reviews and autocheck

* Modifications for the reviews and autocheck

* Update homeassistant/components/lgthinq/const.py

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

* Update homeassistant/components/lgthinq/const.py

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

* Update homeassistant/components/lgthinq/const.py

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

* Update homeassistant/components/lgthinq/device.py

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

* Update homeassistant/components/lgthinq/device.py

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

* Remove type definition after Final

* Update const.py

Do not use Final for DOMAIN

* Refactoring for reviews
- remove thinq.py
- remove type definition
- remove entry name in config flow
- put config flow steps into a single step

* Update tests
- remove region

* Refactoring for reviews
- move property.py into PyPI library
- replace error_code handling with try/catch
- remove http response handling
- remove generic
- remove unnecessary class or map instance
- refactor adding entities logic

* Refactoring
- remove unused code
- change import path

* Update tests

* Refactoring for reviews
1. Use coordinator extended class instead of LGDevice
2. Rename entity_helper.py to entity.py
3. Move entity description to each entity file
4. Remove dynamic device creation code

* Refactoring for reviews

* Update requirements

* Fix for reviews

* Modify tests for reviews

* Update for reviews

* Remove property info and description class

* Update tests/components/lgthinq/test_config_flow.py

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

* Update tests/components/lgthinq/test_config_flow.py

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

* Update homeassistant/components/lgthinq/entity.py

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

* Update homeassistant/components/lgthinq/switch.py

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

* Update tests/components/lgthinq/test_config_flow.py

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

* Update for reviews

* Update homeassistant/components/lgthinq/switch.py

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

* Update homeassistant/components/lgthinq/switch.py

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

* Update for reviews

* Fix ruff issues

* Fix ruff check

* Fix for reviews

* Fix ruff check

* Fix for reviews

* Fix prettier failure and hassfest failure

---------

Co-authored-by: Jangwon Lee <jangwon.lee@lge.com>
Co-authored-by: yunseon.park <yunseon.park@lge.com>
Co-authored-by: nahyun.lee <nahyun.lee@lge.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-30 15:12:49 +02:00
puddly
6467c8d611 Bump ZHA to 0.0.32 (#124804)
* Always prefer XY color mode in ZHA

Remove a few more HS remnants

* Use new ZHA OTA format

* Bump ZHA to 0.0.32

* Fix existing OTA unit tests

* Fix schema conversion test to account for new command parameters

* Update snapshot with new `zcl_type` kwarg

* Migrate existing entities to icon translations

* Remove "no longer compatible" test

* Test that the library release summary is correctly exposed to ZHA

* Revert "Always prefer XY color mode in ZHA"

This reverts commit 8fb7789ea8.

* Test `release_notes`, not `release_summary`
2024-08-30 14:48:09 +02:00
Robert Svensson
c47b37af4f Use snapshot in Axis camera tests (#122677) 2024-08-30 14:40:28 +02:00
starkillerOG
a5bacf5652 Add 100% coverage of Reolink switch platform (#124482)
* Add 100% switch test coverage

* use DOMAIN instead of const.DOMAIN

* Split tests and use parametrize

* Revert "Split tests and use parametrize"

This reverts commit 50d2184ce6.

* fixes
2024-08-30 14:39:12 +02:00
starkillerOG
6589216ed3 Add 100% coverage of Reolink camera platform (#124381)
* Add 100% camera test coverage

* review comments

* use DOMAIN instead of const.DOMAIN

* use entity_registry_enabled_by_default fixture

* fixes
2024-08-30 14:34:49 +02:00
starkillerOG
b6dc410464 Add 100% coverage of Reolink light platform (#124382)
* Add 100% light test coverage

* review comments

* fix

* use STATE_ON

* split tests
2024-08-30 14:34:17 +02:00
starkillerOG
928ff7c78c Add 100% coverage of Reolink sensor platform (#124472)
* Add 100% sensor test coverage

* use DOMAIN instead of const.DOMAIN

* snake_case

* better split tests

* styling

* Use entity_registry_enabled_by_default fixture
2024-08-30 14:32:57 +02:00
tdfountain
c9335598db Alphabetize keys list for nut sensor icons (#124188)
Alphabetize keys list for sensor icons
2024-08-30 14:32:32 +02:00
Jeef
32babd3958 Clean up Weatherflow Cloud (#124643)
cleanup
2024-08-30 13:32:07 +02:00
shapournemati-iotty
7f405686d1 Add shapournemati to iotty codeowners (#123649)
* add shapournemati to codeowners for improved support

* update codeowners with hassfest script

* update codeowners with hassfest script
2024-08-30 13:30:56 +02:00
Lektri.co
5bd736029f Add lektrico integration (#102371)
* Add Lektrico Integration

* Make the changes proposed by Lash-L: new coordinator.py, new entity.py; use: translation_key, last_update_sucess, PlatformNotReady; remove: global variables

* Replace FlowResult with ConfigFlowResult and add tests.

* Remove unused lines.

* Remove Options from condif_flow

* Fix ruff and mypy.

* Fix CODEOWNERS.

* Run python3 -m script.hassfest.

* Correct rebase mistake.

* Make modifications suggested by emontnemery.

* Add pytest fixtures.

* Remove meaningless patches.

* Update .coveragerc

* Replace CONF_FRIENDLY_NAME with CONF_NAME.

* Remove underscores.

* Update tests.

* Update test file with is and no config_entries. .

* Set serial_number in DeviceInfo and add return type of the async_update_data to DataUpdateCoordinator.

* Use suggested_unit_of_measurement for KILO_WATT and replace Any in value_fn (sensor file).

* Add device class duration to charging_time sensor.

* Change raising  PlatformNotReady to raising IntegrationError.

* Test the unique id of the entry.

* Rename PF Lx with Power factor Lx and remove PF from strings.json.

* Remove comment.

* Make state and limit reason sensors to be enum sensors.

* Use result variable to check unique_id in test.

* Remove CONF_NAME from entry and __init__ from LektricoFlowHandler.

* Remove session parameter from LektricoDeviceDataUpdateCoordinator.

* Use config_entry: ConfigEntry in coordinator.

* Replace Connected,NeedAuth with Waiting for Authentication.

* Use lektricowifi 0.0.29.

* Use lektricowifi 0.0.39

* Use lektricowifi 0.0.40

* Use lektricowifi 0.0.41

* Replace hass.data with entry.runtime_data

* Delete .coveragerc

* Restructure the user step

* Fix tests

* Add returned value of _async_update_data to class DataUpdateCoordinator

* Use hw_version at DeviceInfo

* Remove a variable

* Use StateType

* Replace friendly_name with device_name

* Use sentence case in translation strings

* Uncomment and fix test_discovered_zeroconf

* Add type LektricoConfigEntry

* Remove commented code

* Remove the type of coordinator in sensor async_setup_entry

* Make zeroconf test end in ABORT, not FORM

* Remove all async_block_till_done from tests

* End test_user_setup_device_offline with CREATE_ENTRY

* Patch the full Device

* Add snapshot tests

* Overwrite the type LektricoSensorEntityDescription outside of the constructor

* Test separate already_configured for zeroconf

---------

Co-authored-by: mihaela.tarjoianu <mihaela.tarjoianu@scada.ro>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-08-30 13:20:15 +02:00
Robert Resch
397198c6d0 Optimize hassfest image (#124855)
* Optimize hassfest docker image

* Adjust CI

* Use dynamic uv version

* Remove workaround
2024-08-30 13:09:10 +02:00
Michael Arthur
54188b4128 Add returning activity to Husqvarna lawn mower (#124511)
* add returning activity to husqvarna lawn mower

* Update test, fix bug with comparison operator
2024-08-30 12:59:13 +02:00
Jeef
f3da9de744 Bump weatherflow4py to 0.2.23 (#124072)
patch weatherflow for new data
2024-08-30 12:45:08 +02:00
Raj Laud
aeb95c4509 Bump pysqueezebox to v0.8.1 (#124856) 2024-08-30 12:43:29 +02:00
Louis Christ
f394dfb8d0 Handle CancelledError in bluesound integration (#124873)
Catch CancledError in async_will_remove_from_hass
2024-08-30 11:38:07 +02:00
J. Nick Koston
6781a76de2 Speed up ssdp domain matching (#124842)
* Speed up ssdp domain matching

Switch all() expression to dict.items() <= dict.items()

* rewrite as setcomp
2024-08-30 11:36:31 +02:00
epenet
69a9aa4594 Improve type hints in icloud config flow (#124900) 2024-08-30 11:25:58 +02:00
epenet
afa02dcce9 Improve type hints in growatt_server config flow (#124901) 2024-08-30 11:25:29 +02:00
epenet
febb382030 Improve type hints in hvv_departures config flow (#124902) 2024-08-30 11:25:08 +02:00
epenet
1906155c18 Improve type hints in mobile_app config flow (#124906) 2024-08-30 11:24:34 +02:00
epenet
ffabd5d7db Improve type hints in konnected config flow (#124904) 2024-08-30 11:24:06 +02:00
Christopher Fenner
9e2360791d Add hot water target temp number entity in ViCare integration (#123633)
* add DHW target temp number entity

* Update number.py

* Update strings.json

* Update strings.json

* update test snapshot

* fix snapshot
2024-08-30 11:22:48 +02:00
epenet
19cbc1b258 Improve type hints in plex config flow (#124914) 2024-08-30 11:22:07 +02:00
epenet
df2ea1e875 Improve type hints in nina config flow (#124910)
* Improve type hints in nina config flow

* Apply suggestions from code review

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

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-30 11:21:05 +02:00
epenet
74fa30e59d Improve config flow type hints (g-m) (#124907) 2024-08-30 11:05:18 +02:00
epenet
6833af6286 Improve config flow type hints (n-p) (#124909) 2024-08-30 11:04:58 +02:00
Josef Zweck
4940968cd5 Bump lmcloud 1.2.2 (#124911)
bump lmcloud 1.2.2
2024-08-30 11:02:29 +02:00
dependabot[bot]
a9975071c3 Bump actions/setup-python from 5.1.1 to 5.2.0 (#124899)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.1 to 5.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.1.1...v5.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-30 10:53:06 +02:00
Christopher Fenner
cc4340b80c Remove update call from init in ViCare integration (#124905)
fix
2024-08-30 10:50:18 +02:00
Willem-Jan van Rootselaar
252f05e0f7 Update diagnostics for BSBLan (#124508)
* update diagnostics to include static

and make room for multiple coordinator data objects

* fix mac address is not stored in config_entry but on device
2024-08-30 10:41:07 +02:00
dependabot[bot]
f5e0382123 Bump github/codeql-action from 3.26.5 to 3.26.6 (#124898)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.5 to 3.26.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.5...v3.26.6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-30 10:29:25 +02:00
Josef Zweck
600c6a0dcb Bump lmcloud to 1.2.1 (#124908) 2024-08-30 10:05:28 +02:00
J. Nick Koston
df60e59a95 Address yale review comments part 2 (#124887)
* Remove some unneeded block till done

* Additional state check cleanups and snapshots

* Use more snapshots in yale tests
2024-08-30 09:37:19 +02:00
J. Nick Koston
cf90e77e57 Add a repair issue for Yale Home users using the August integration (#124895)
The Yale Home brand will stop working with the August integration very
soon. Users must migrate to the Yale integration to avoid an interruption in service.
2024-08-30 09:35:19 +02:00
J. Nick Koston
3e0bd44d2a Bump aioesphomeapi to 25.3.1 (#124890)
changelog: https://github.com/esphome/aioesphomeapi/compare/v25.2.1...v25.3.1
2024-08-29 16:19:12 -10:00
Erik Montnemery
7bb93d4f3e Deduplicate warning messages in recorder DB migration (#124845) 2024-08-29 19:05:27 -07:00
Tony
4dfc11a140 Bump aioruckus to v0.41 removing blocking call to load_default_certs from ruckus_unleashed integration (#123974)
* fix ruckusd_unleashed blocking call to load_default_certs

* remove extra loggers, bump aioruckus ver for debian packagers
2024-08-29 19:03:51 -07:00
TheJulianJES
7eeebf198b Fix ZHA group removal entity registry cleanup (#124889)
* Fix ZHA cleanup entity registry parameter

* Fix missing `gateway` when accessing coordinator device

* Get `ZHADeviceProxy` for coordinator device
2024-08-29 20:13:47 -04:00
J. Nick Koston
175ffe29f6 Bump yalexs to 8.5.5 (#124891)
changelog: https://github.com/bdraco/yalexs/compare/v8.5.4...v8.5.5
2024-08-30 01:07:21 +02:00
Michael Hansen
ff9937f942 Bump intents to 2024.8.29 (#124874) 2024-08-29 13:29:11 -05:00
Robert Resch
ef452427e3 Bump PyTurboJPEG to 1.7.5 (#124865) 2024-08-29 19:34:19 +02:00
J. Nick Koston
a04970bd54 Address august review comments (#124819)
* Address august review comments

Followup to https://github.com/home-assistant/core/pull/124677

* cleanup loop

* drop mixin name

* event entity add cleanup

* remove duplicate prop

* pep0695 type

* remove some not needed block till done

* cleanup august tests

* switch to freezegun

* snapshots for dev reg

* SOURCE_USER nit

* snapshots

* pytest.raises

* not loaded check
2024-08-29 19:32:13 +02:00
Joost Lekkerkerker
149aebb0bc Add missing translation key in Knocki (#124862) 2024-08-29 17:25:04 +02:00
Bram Kragten
c36fc70ab4 Update frontend to 20240829.0 (#124864) 2024-08-29 17:24:25 +02:00
epenet
681fe3485d Improve config flow type hints (a-f) (#124859) 2024-08-29 17:24:04 +02:00
Fredrik Erlandsson
34680becaa Bump pydaikin to 2.13.6 (#124852) 2024-08-29 13:20:57 +02:00
Erik Montnemery
354f4491c8 Avoid unnecessary copying of variables when setting up automations (#124844) 2024-08-29 13:03:47 +02:00
Andrew Jackson
c4fd1cfc8f Fix Mastodon migrate config entry log warning (#124848)
Fix migrate config entry
2024-08-29 12:23:04 +02:00
Erik Montnemery
a4e9e4b23b Tweak exception message in yaml loader (#124841) 2024-08-29 11:31:19 +02:00
Pete Sage
eac7794741 Fix sonos get_queue service call to restrict to sonos media_player entities (#124815)
add sonos to filter
2024-08-29 11:29:54 +02:00
Jan Bouwhuis
1cb9690001 Cleanup unused hass_storage mocks in mqtt tests (#124846) 2024-08-29 10:52:57 +02:00
AutonomousOwl
1101e7ef64 Update utility_account_id in Opower to be lowercase in statistic id (#124837)
Update utility_account_id to be lowercase in statistic id
2024-08-28 23:34:13 -07:00
Tobias Sauerwein
3b6128d590 Bump pyatmo to 8.1.0 (#124340) 2024-08-29 07:59:07 +02:00
Jeremy Cook
7f4fca63ed SmartThings edge driver for heatit thermostats does not require cooling setpoint (#123188)
* remove cooling setpoint requirement for thermostats. Air conditioning remains unchanged

* remove cooling setpoint requirement for thermostats. Air conditioning remains unchanged

* versions should not be set on core integrations.

* Added tests for minimal smartthings thermostat with no cooling.

* Added tests for minimal smartthings thermostat with no cooling.

* Formatted tests with ruff format
2024-08-29 07:49:05 +02:00
J. Nick Koston
4b59ef4733 Set GoogleEntity entity_id in constructor (#124830) 2024-08-28 15:47:11 -10:00
David Bonnes
3d39f6ce88 Fix evohome test by setting datetime to match snapshot (#124824)
* initial commit

* freeze time instead

* use fixture instead of API
2024-08-29 00:34:20 +02:00
J. Nick Koston
5f810d908f Add missing dependencies to yale (#124821)
* Add missing dependencies to yale

* try another way

* Revert "try another way"

This reverts commit fbb731a334.

* patch out cloud setup
2024-08-29 00:28:41 +02:00
AlCalzone
c7cfd56b72 Support Z-Wave JS dimming lights using color intensity (#122639)
* Z-Wave JS: support non-dimmable color lights

* remove black_is_off light, support on/off/color

* fix: tests for on/off light

* fix: typo

* remove commented out old test code

* add test for off and on

* support colored lights without separate brightness control

* add test for color-only light

* refactor: extract color only light

* fix: preserve color when changing brightness

* extend tests

* refactor again

* refactor scale check

* refactor: remove impossible check

* review feedback

* review feedback

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-08-29 00:01:53 +02:00
David Bonnes
ada6b7875c Add evohome test for setup (#123129)
* allow for different systems

* installation is a load_json_*fixture param

* allow installation to be parameterized

* test setup of various systems

* add more fixtures

* test setup of integration

* tweak test

* tweak const

* add expected state/services

* extend setup test

* tidy up

* tidy up tweaks

* code tweaks

* refactor expected results dicts

* woops

* refatcor serialize

* refactor test

* tweak

* tweak code

* rename symbol

* ensure actual I/O remains blocked

* tweak

* typo

* use constants

* Update conftest.py

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

* change filename

* add config fixture

* config is a fixture

* config is a fixture now 2

* lint

* lint

* refactor

* lint

* lint

* restore email addr

* use const

* use snapshots instead of helper class

* doctweak

* correct snapshot

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-08-28 22:40:57 +02:00
Fredrik Erlandsson
2b20b2a80b Bump tellduslive to 0.10.12 (#124816)
* Bump tellduslive version

* update licenses.py too
2024-08-28 22:10:49 +03:00
J. Nick Koston
5825e8fee8 Redirect virtual integration yale_home to point to yale (#124817) 2024-08-28 09:01:17 -10:00
J. Nick Koston
70488ffd15 Address yale review comments (#124810)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-28 09:00:52 -10:00
epenet
2900fa733d Use reauth_confirm in co2signal (#124781) 2024-08-28 20:43:11 +02:00
epenet
7d61dd13d9 Use reauth_confirm in discovergy (#124782) 2024-08-28 20:42:50 +02:00
Fredrik Erlandsson
af8131e68f Bump pydaikin to 2.13.5 (#124802)
bump pydaikin version
2024-08-28 19:19:04 +02:00
Blake Bryant
c049129147 Add Deako integration (#121132)
* Deako integration using pydeako

* fix: address feedback

- make unit tests more e2e
- use runtime_data to store connection

* fix: address feedback part 2

- added better type safety for Deako config entries
- refactored the config flow tests to use a conftest mock instead of directly patching
- removed pytest.mark.asyncio test decorators

* fix: address feedback pt 3

- simplify config entry type
- add test for single_instance_allowed
- remove light.py get_state(), only used once, no need to be separate function

* fix: ruff format

* Update homeassistant/components/deako/__init__.py

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

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-28 19:16:05 +02:00
Robert Resch
2dce876a86 Bump version to 2024.10.0dev0 (#124808) 2024-08-28 18:51:50 +02:00
J. Nick Koston
148bb05dea loop 2024-07-29 21:47:55 -05:00
J. Nick Koston
4d01e0a773 cleanup 2024-07-29 21:43:08 -05:00
J. Nick Koston
15d8b84074 adjust 2024-07-29 21:31:36 -05:00
J. Nick Koston
2208262ca5 debug 2024-07-29 21:27:17 -05:00
J. Nick Koston
0c2a0118e2 event types 2024-07-29 21:23:10 -05:00
J. Nick Koston
93fe46509f lint 2024-07-29 21:19:07 -05:00
J. Nick Koston
581efad5a7 lint 2024-07-29 21:18:01 -05:00
J. Nick Koston
0492639d51 Add support for event entities to lutron_caseta 2024-07-29 21:03:48 -05:00
1329 changed files with 59309 additions and 14311 deletions

View File

@@ -14,6 +14,7 @@ core: &core
base_platforms: &base_platforms
- homeassistant/components/air_quality/**
- homeassistant/components/alarm_control_panel/**
- homeassistant/components/assist_satellite/**
- homeassistant/components/binary_sensor/**
- homeassistant/components/button/**
- homeassistant/components/calendar/**

View File

@@ -32,7 +32,7 @@ jobs:
fetch-depth: 0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -69,7 +69,7 @@ jobs:
run: find ./homeassistant/components/*/translations -name "*.json" | tar zcvf translations.tar.gz -T -
- name: Upload translations
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: translations
path: translations.tar.gz
@@ -116,7 +116,7 @@ jobs:
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
if: needs.init.outputs.channel == 'dev'
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -453,7 +453,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -491,7 +491,7 @@ jobs:
packages: write
attestations: write
id-token: write
needs: ["init", "build_base"]
needs: ["init"]
if: github.repository_owner == 'home-assistant'
env:
HASSFEST_IMAGE_NAME: ghcr.io/home-assistant/hassfest
@@ -510,8 +510,8 @@ jobs:
- name: Build Docker image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: ./script/hassfest/docker
build-args: BASE_IMAGE=ghcr.io/home-assistant/amd64-homeassistant:${{ needs.init.outputs.version }}
context: . # So action will not pull the repository again
file: ./script/hassfest/docker/Dockerfile
load: true
tags: ${{ env.HASSFEST_IMAGE_TAG }}
@@ -523,8 +523,8 @@ jobs:
id: push
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: ./script/hassfest/docker
build-args: BASE_IMAGE=ghcr.io/home-assistant/amd64-homeassistant:${{ needs.init.outputs.version }}
context: . # So action will not pull the repository again
file: ./script/hassfest/docker/Dockerfile
push: true
tags: ${{ env.HASSFEST_IMAGE_TAG }},${{ env.HASSFEST_IMAGE_NAME }}:latest

View File

@@ -40,7 +40,7 @@ env:
CACHE_VERSION: 10
UV_CACHE_VERSION: 1
MYPY_CACHE_VERSION: 8
HA_SHORT_VERSION: "2024.9"
HA_SHORT_VERSION: "2024.10"
DEFAULT_PYTHON: "3.12"
ALL_PYTHON_VERSIONS: "['3.12']"
# 10.3 is the oldest supported version
@@ -234,7 +234,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -279,7 +279,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -319,7 +319,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -359,7 +359,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -429,17 +429,32 @@ jobs:
. venv/bin/activate
pre-commit run --show-diff-on-failure --hook-stage manual codespell --all-files
lint-hadolint:
name: Check ${{ matrix.file }}
runs-on: ubuntu-24.04
needs:
- info
if: |
github.event.inputs.pylint-only != 'true'
&& github.event.inputs.mypy-only != 'true'
&& github.event.inputs.audit-licenses-only != 'true'
strategy:
fail-fast: false
matrix:
file:
- Dockerfile
- Dockerfile.dev
- script/hassfest/docker/Dockerfile
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Register hadolint problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/hadolint.json"
- name: Check Dockerfile
uses: docker://hadolint/hadolint:v1.18.2
- name: Check ${{ matrix.file }}
uses: docker://hadolint/hadolint:v2.12.0
with:
args: hadolint Dockerfile
- name: Check Dockerfile.dev
uses: docker://hadolint/hadolint:v1.18.2
with:
args: hadolint Dockerfile.dev
args: hadolint ${{ matrix.file }}
base:
name: Prepare dependencies
@@ -454,7 +469,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -538,7 +553,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -571,7 +586,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -605,7 +620,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -623,7 +638,7 @@ jobs:
. venv/bin/activate
pip-licenses --format=json --output-file=licenses.json
- name: Upload licenses
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: licenses
path: licenses.json
@@ -648,7 +663,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -695,7 +710,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -740,7 +755,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -815,7 +830,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -833,7 +848,7 @@ jobs:
. venv/bin/activate
python -m script.split_tests ${{ needs.info.outputs.test_group_count }} tests
- name: Upload pytest_buckets
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: pytest_buckets
path: pytest_buckets.txt
@@ -879,7 +894,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -934,14 +949,14 @@ jobs:
2>&1 | tee pytest-${{ matrix.python-version }}-${{ matrix.group }}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-full.conclusion == 'failure'
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{ matrix.group }}
path: pytest-*.txt
overwrite: true
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
path: coverage.xml
@@ -999,7 +1014,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -1060,7 +1075,7 @@ jobs:
2>&1 | tee pytest-${{ matrix.python-version }}-${mariadb}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-partial.conclusion == 'failure'
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.mariadb }}
@@ -1068,7 +1083,7 @@ jobs:
overwrite: true
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: coverage-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.mariadb }}
@@ -1125,7 +1140,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -1187,7 +1202,7 @@ jobs:
2>&1 | tee pytest-${{ matrix.python-version }}-${postgresql}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-partial.conclusion == 'failure'
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.postgresql }}
@@ -1195,7 +1210,7 @@ jobs:
overwrite: true
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: coverage-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.postgresql }}
@@ -1271,7 +1286,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -1329,14 +1344,14 @@ jobs:
2>&1 | tee pytest-${{ matrix.python-version }}-${{ matrix.group }}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-partial.conclusion == 'failure'
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{ matrix.group }}
path: pytest-*.txt
overwrite: true
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
path: coverage.xml

View File

@@ -24,11 +24,11 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.26.5
uses: github/codeql-action/init@v3.26.6
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.26.5
uses: github/codeql-action/analyze@v3.26.6
with:
category: "/language:python"

View File

@@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}

View File

@@ -36,7 +36,7 @@ jobs:
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -82,14 +82,15 @@ jobs:
) > .env_file
- name: Upload env_file
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: env_file
path: ./.env_file
include-hidden-files: true
overwrite: true
- name: Upload requirements_diff
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: requirements_diff
path: ./requirements_diff.txt
@@ -101,7 +102,7 @@ jobs:
python -m script.gen_requirements_all ci
- name: Upload requirements_all_wheels
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: requirements_all_wheels
path: ./requirements_all_wheels_*.txt
@@ -139,7 +140,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "libffi-dev;openssl-dev;yaml-dev;nasm"
skip-binary: aiohttp
skip-binary: aiohttp;multidict;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements.txt"
@@ -211,7 +212,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf;pydantic;pymicro-vad
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_old-cython.txt"
@@ -226,7 +227,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf;pydantic;pymicro-vad
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtaa"
@@ -240,7 +241,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf;pydantic;pymicro-vad
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtab"
@@ -254,7 +255,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf;pydantic;pymicro-vad
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtac"

View File

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.2
rev: v0.6.4
hooks:
- id: ruff
args:

View File

@@ -95,6 +95,7 @@ homeassistant.components.aruba.*
homeassistant.components.arwn.*
homeassistant.components.aseko_pool_live.*
homeassistant.components.assist_pipeline.*
homeassistant.components.assist_satellite.*
homeassistant.components.asuswrt.*
homeassistant.components.autarco.*
homeassistant.components.auth.*
@@ -110,6 +111,7 @@ homeassistant.components.bitcoin.*
homeassistant.components.blockchain.*
homeassistant.components.blue_current.*
homeassistant.components.blueprint.*
homeassistant.components.bluesound.*
homeassistant.components.bluetooth.*
homeassistant.components.bluetooth_adapters.*
homeassistant.components.bluetooth_tracker.*
@@ -139,6 +141,7 @@ homeassistant.components.cpuspeed.*
homeassistant.components.crownstone.*
homeassistant.components.date.*
homeassistant.components.datetime.*
homeassistant.components.deako.*
homeassistant.components.deconz.*
homeassistant.components.default_config.*
homeassistant.components.demo.*
@@ -208,6 +211,8 @@ homeassistant.components.glances.*
homeassistant.components.goalzero.*
homeassistant.components.google.*
homeassistant.components.google_assistant_sdk.*
homeassistant.components.google_cloud.*
homeassistant.components.google_photos.*
homeassistant.components.google_sheets.*
homeassistant.components.gpsd.*
homeassistant.components.greeneye_monitor.*
@@ -278,6 +283,7 @@ homeassistant.components.lawn_mower.*
homeassistant.components.lcn.*
homeassistant.components.ld2410_ble.*
homeassistant.components.led_ble.*
homeassistant.components.lektrico.*
homeassistant.components.lidarr.*
homeassistant.components.lifx.*
homeassistant.components.light.*
@@ -310,6 +316,7 @@ homeassistant.components.minecraft_server.*
homeassistant.components.mjpeg.*
homeassistant.components.modbus.*
homeassistant.components.modem_callerid.*
homeassistant.components.mold_indicator.*
homeassistant.components.monzo.*
homeassistant.components.moon.*
homeassistant.components.mopeka.*
@@ -336,6 +343,7 @@ homeassistant.components.nut.*
homeassistant.components.onboarding.*
homeassistant.components.oncue.*
homeassistant.components.onewire.*
homeassistant.components.onkyo.*
homeassistant.components.open_meteo.*
homeassistant.components.openexchangerates.*
homeassistant.components.opensky.*
@@ -395,6 +403,7 @@ homeassistant.components.select.*
homeassistant.components.sensibo.*
homeassistant.components.sensirion_ble.*
homeassistant.components.sensor.*
homeassistant.components.sensoterra.*
homeassistant.components.senz.*
homeassistant.components.sfr_box.*
homeassistant.components.shelly.*
@@ -407,9 +416,11 @@ homeassistant.components.slack.*
homeassistant.components.sleepiq.*
homeassistant.components.smhi.*
homeassistant.components.snooz.*
homeassistant.components.solarlog.*
homeassistant.components.sonarr.*
homeassistant.components.speedtestdotnet.*
homeassistant.components.sql.*
homeassistant.components.squeezebox.*
homeassistant.components.ssdp.*
homeassistant.components.starlink.*
homeassistant.components.statistics.*

View File

@@ -143,6 +143,8 @@ build.json @home-assistant/supervisor
/tests/components/aseko_pool_live/ @milanmeu
/homeassistant/components/assist_pipeline/ @balloob @synesthesiam
/tests/components/assist_pipeline/ @balloob @synesthesiam
/homeassistant/components/assist_satellite/ @home-assistant/core @synesthesiam
/tests/components/assist_satellite/ @home-assistant/core @synesthesiam
/homeassistant/components/asuswrt/ @kennedyshead @ollo69
/tests/components/asuswrt/ @kennedyshead @ollo69
/homeassistant/components/atag/ @MatsNL
@@ -228,8 +230,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/bsblan/ @liudger
/tests/components/bsblan/ @liudger
/homeassistant/components/bt_smarthub/ @typhoon2099
/homeassistant/components/bthome/ @Ernst79
/tests/components/bthome/ @Ernst79
/homeassistant/components/bthome/ @Ernst79 @thecode
/tests/components/bthome/ @Ernst79 @thecode
/homeassistant/components/buienradar/ @mjj4791 @ties @Robbie1221
/tests/components/buienradar/ @mjj4791 @ties @Robbie1221
/homeassistant/components/button/ @home-assistant/core
@@ -294,6 +296,8 @@ build.json @home-assistant/supervisor
/tests/components/date/ @home-assistant/core
/homeassistant/components/datetime/ @home-assistant/core
/tests/components/datetime/ @home-assistant/core
/homeassistant/components/deako/ @sebirdman @balake @deakolights
/tests/components/deako/ @sebirdman @balake @deakolights
/homeassistant/components/debugpy/ @frenck
/tests/components/debugpy/ @frenck
/homeassistant/components/deconz/ @Kane610
@@ -547,11 +551,14 @@ build.json @home-assistant/supervisor
/tests/components/google_assistant/ @home-assistant/cloud
/homeassistant/components/google_assistant_sdk/ @tronikos
/tests/components/google_assistant_sdk/ @tronikos
/homeassistant/components/google_cloud/ @lufton
/homeassistant/components/google_cloud/ @lufton @tronikos
/tests/components/google_cloud/ @lufton @tronikos
/homeassistant/components/google_generative_ai_conversation/ @tronikos
/tests/components/google_generative_ai_conversation/ @tronikos
/homeassistant/components/google_mail/ @tkdrob
/tests/components/google_mail/ @tkdrob
/homeassistant/components/google_photos/ @allenporter
/tests/components/google_photos/ @allenporter
/homeassistant/components/google_sheets/ @tkdrob
/tests/components/google_sheets/ @tkdrob
/homeassistant/components/google_tasks/ @allenporter
@@ -629,6 +636,8 @@ build.json @home-assistant/supervisor
/tests/components/homewizard/ @DCSBL
/homeassistant/components/honeywell/ @rdfurman @mkmer
/tests/components/honeywell/ @rdfurman @mkmer
/homeassistant/components/html5/ @alexyao2015
/tests/components/html5/ @alexyao2015
/homeassistant/components/http/ @home-assistant/core
/tests/components/http/ @home-assistant/core
/homeassistant/components/huawei_lte/ @scop @fphammerle
@@ -707,8 +716,8 @@ build.json @home-assistant/supervisor
/tests/components/ios/ @robbiet480
/homeassistant/components/iotawatt/ @gtdiehl @jyavenard
/tests/components/iotawatt/ @gtdiehl @jyavenard
/homeassistant/components/iotty/ @pburgio
/tests/components/iotty/ @pburgio
/homeassistant/components/iotty/ @pburgio @shapournemati-iotty
/tests/components/iotty/ @pburgio @shapournemati-iotty
/homeassistant/components/iperf3/ @rohankapoorcom
/homeassistant/components/ipma/ @dgomes
/tests/components/ipma/ @dgomes
@@ -721,6 +730,8 @@ build.json @home-assistant/supervisor
/tests/components/iron_os/ @tr4nt0r
/homeassistant/components/isal/ @bdraco
/tests/components/isal/ @bdraco
/homeassistant/components/iskra/ @iskramis
/tests/components/iskra/ @iskramis
/homeassistant/components/islamic_prayer_times/ @engrbm87 @cpfair
/tests/components/islamic_prayer_times/ @engrbm87 @cpfair
/homeassistant/components/israel_rail/ @shaiu
@@ -797,8 +808,12 @@ build.json @home-assistant/supervisor
/tests/components/leaone/ @bdraco
/homeassistant/components/led_ble/ @bdraco
/tests/components/led_ble/ @bdraco
/homeassistant/components/lektrico/ @lektrico
/tests/components/lektrico/ @lektrico
/homeassistant/components/lg_netcast/ @Drafteed @splinter98
/tests/components/lg_netcast/ @Drafteed @splinter98
/homeassistant/components/lg_thinq/ @LG-ThinQ-Integration
/tests/components/lg_thinq/ @LG-ThinQ-Integration
/homeassistant/components/lidarr/ @tkdrob
/tests/components/lidarr/ @tkdrob
/homeassistant/components/lifx/ @Djelibeybi
@@ -1275,6 +1290,8 @@ build.json @home-assistant/supervisor
/tests/components/sensorpro/ @bdraco
/homeassistant/components/sensorpush/ @bdraco
/tests/components/sensorpush/ @bdraco
/homeassistant/components/sensoterra/ @markruys
/tests/components/sensoterra/ @markruys
/homeassistant/components/sentry/ @dcramer @frenck
/tests/components/sentry/ @dcramer @frenck
/homeassistant/components/senz/ @milanmeu
@@ -1623,6 +1640,8 @@ build.json @home-assistant/supervisor
/tests/components/webostv/ @thecode
/homeassistant/components/websocket_api/ @home-assistant/core
/tests/components/websocket_api/ @home-assistant/core
/homeassistant/components/weheat/ @jesperraemaekers
/tests/components/weheat/ @jesperraemaekers
/homeassistant/components/wemo/ @esev
/tests/components/wemo/ @esev
/homeassistant/components/whirlpool/ @abmantis @mkmer

View File

@@ -9,6 +9,7 @@
"google_generative_ai_conversation",
"google_mail",
"google_maps",
"google_photos",
"google_pubsub",
"google_sheets",
"google_tasks",

View File

@@ -1,5 +1,5 @@
{
"domain": "lg",
"name": "LG",
"integrations": ["lg_netcast", "lg_soundbar", "webostv"]
"integrations": ["lg_netcast", "lg_thinq", "lg_soundbar", "webostv"]
}

View File

@@ -6,52 +6,3 @@ Component design guidelines:
format "<DOMAIN>.<OBJECT_ID>".
- Each component should publish services only under its own domain.
"""
from __future__ import annotations
import logging
from homeassistant.core import HomeAssistant, split_entity_id
from homeassistant.helpers.frame import report
from homeassistant.helpers.group import expand_entity_ids
_LOGGER = logging.getLogger(__name__)
def is_on(hass: HomeAssistant, entity_id: str | None = None) -> bool:
"""Load up the module to call the is_on method.
If there is no entity id given we will check all.
"""
report(
(
"uses homeassistant.components.is_on."
" This is deprecated and will stop working in Home Assistant 2024.9, it"
" should be updated to use the function of the platform directly."
),
error_if_core=True,
)
if entity_id:
entity_ids = expand_entity_ids(hass, [entity_id])
else:
entity_ids = hass.states.entity_ids()
for ent_id in entity_ids:
domain = split_entity_id(ent_id)[0]
try:
component = getattr(hass.components, domain)
except ImportError:
_LOGGER.error("Failed to call %s.is_on: component not found", domain)
continue
if not hasattr(component, "is_on"):
_LOGGER.warning("Integration %s has no is_on method", domain)
continue
if component.is_on(ent_id):
return True
return False

View File

@@ -18,6 +18,7 @@ from homeassistant.const import (
UV_INDEX,
UnitOfIrradiance,
UnitOfLength,
UnitOfPressure,
UnitOfSpeed,
UnitOfTemperature,
UnitOfTime,
@@ -279,6 +280,15 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
value_fn=lambda data: cast(float, data[API_METRIC][ATTR_VALUE]),
translation_key="realfeel_temperature_shade",
),
AccuWeatherSensorDescription(
key="RelativeHumidity",
device_class=SensorDeviceClass.HUMIDITY,
entity_registry_enabled_default=False,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE,
value_fn=lambda data: cast(int, data),
translation_key="humidity",
),
AccuWeatherSensorDescription(
key="Precipitation",
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
@@ -288,6 +298,16 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
attr_fn=lambda data: {"type": data["PrecipitationType"]},
translation_key="precipitation",
),
AccuWeatherSensorDescription(
key="Pressure",
device_class=SensorDeviceClass.PRESSURE,
entity_registry_enabled_default=False,
state_class=SensorStateClass.MEASUREMENT,
suggested_display_precision=0,
native_unit_of_measurement=UnitOfPressure.HPA,
value_fn=lambda data: cast(float, data[API_METRIC][ATTR_VALUE]),
translation_key="pressure",
),
AccuWeatherSensorDescription(
key="PressureTendency",
device_class=SensorDeviceClass.ENUM,
@@ -295,9 +315,19 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
value_fn=lambda data: cast(str, data["LocalizedText"]).lower(),
translation_key="pressure_tendency",
),
AccuWeatherSensorDescription(
key="Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
entity_registry_enabled_default=False,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
value_fn=lambda data: cast(float, data[API_METRIC][ATTR_VALUE]),
translation_key="temperature",
),
AccuWeatherSensorDescription(
key="UVIndex",
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
native_unit_of_measurement=UV_INDEX,
value_fn=lambda data: cast(int, data),
attr_fn=lambda data: {ATTR_LEVEL: data["UVIndexText"]},
@@ -324,6 +354,7 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
AccuWeatherSensorDescription(
key="Wind",
device_class=SensorDeviceClass.WIND_SPEED,
entity_registry_enabled_default=False,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR,
value_fn=lambda data: cast(float, data[ATTR_SPEED][API_METRIC][ATTR_VALUE]),

View File

@@ -3,6 +3,7 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
import homeassistant.helpers.entity_registry as er
from .hub import PulseHub
@@ -17,6 +18,9 @@ async def async_setup_entry(
hass: HomeAssistant, config_entry: AcmedaConfigEntry
) -> bool:
"""Set up Rollease Acmeda Automate hub from a config entry."""
await _migrate_unique_ids(hass, config_entry)
hub = PulseHub(hass, config_entry)
if not await hub.async_setup():
@@ -28,6 +32,19 @@ async def async_setup_entry(
return True
async def _migrate_unique_ids(hass: HomeAssistant, entry: AcmedaConfigEntry) -> None:
"""Migrate pre-config flow unique ids."""
entity_registry = er.async_get(hass)
registry_entries = er.async_entries_for_config_entry(
entity_registry, entry.entry_id
)
for reg_entry in registry_entries:
if isinstance(reg_entry.unique_id, int): # type: ignore[unreachable]
entity_registry.async_update_entity( # type: ignore[unreachable]
reg_entry.entity_id, new_unique_id=str(reg_entry.unique_id)
)
async def async_unload_entry(
hass: HomeAssistant, config_entry: AcmedaConfigEntry
) -> bool:

View File

@@ -67,7 +67,7 @@ class AcmedaBase(entity.Entity):
@property
def unique_id(self) -> str:
"""Return the unique ID of this roller."""
return self.roller.id # type: ignore[no-any-return]
return str(self.roller.id)
@property
def device_id(self) -> str:

View File

@@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/acmeda",
"iot_class": "local_push",
"loggers": ["aiopulse"],
"requirements": ["aiopulse==0.4.4"]
"requirements": ["aiopulse==0.4.6"]
}

View File

@@ -29,18 +29,40 @@ DATA_ADS = "data_ads"
# Supported Types
ADSTYPE_BOOL = "bool"
ADSTYPE_BYTE = "byte"
ADSTYPE_DINT = "dint"
ADSTYPE_INT = "int"
ADSTYPE_UDINT = "udint"
ADSTYPE_UINT = "uint"
ADSTYPE_SINT = "sint"
ADSTYPE_USINT = "usint"
ADSTYPE_DINT = "dint"
ADSTYPE_UDINT = "udint"
ADSTYPE_WORD = "word"
ADSTYPE_DWORD = "dword"
ADSTYPE_LREAL = "lreal"
ADSTYPE_REAL = "real"
ADSTYPE_STRING = "string"
ADSTYPE_TIME = "time"
ADSTYPE_DATE = "date"
ADSTYPE_DATE_AND_TIME = "dt"
ADSTYPE_TOD = "tod"
ADS_TYPEMAP = {
ADSTYPE_BOOL: pyads.PLCTYPE_BOOL,
ADSTYPE_BYTE: pyads.PLCTYPE_BYTE,
ADSTYPE_DINT: pyads.PLCTYPE_DINT,
ADSTYPE_INT: pyads.PLCTYPE_INT,
ADSTYPE_UDINT: pyads.PLCTYPE_UDINT,
ADSTYPE_UINT: pyads.PLCTYPE_UINT,
ADSTYPE_SINT: pyads.PLCTYPE_SINT,
ADSTYPE_USINT: pyads.PLCTYPE_USINT,
ADSTYPE_DINT: pyads.PLCTYPE_DINT,
ADSTYPE_UDINT: pyads.PLCTYPE_UDINT,
ADSTYPE_WORD: pyads.PLCTYPE_WORD,
ADSTYPE_DWORD: pyads.PLCTYPE_DWORD,
ADSTYPE_REAL: pyads.PLCTYPE_REAL,
ADSTYPE_LREAL: pyads.PLCTYPE_LREAL,
ADSTYPE_STRING: pyads.PLCTYPE_STRING,
ADSTYPE_TIME: pyads.PLCTYPE_TIME,
ADSTYPE_DATE: pyads.PLCTYPE_DATE,
ADSTYPE_DATE_AND_TIME: pyads.PLCTYPE_DT,
ADSTYPE_TOD: pyads.PLCTYPE_TOD,
}
CONF_ADS_FACTOR = "factor"
@@ -75,12 +97,23 @@ SCHEMA_SERVICE_WRITE_DATA_BY_NAME = vol.Schema(
{
vol.Required(CONF_ADS_TYPE): vol.In(
[
ADSTYPE_BOOL,
ADSTYPE_BYTE,
ADSTYPE_INT,
ADSTYPE_UINT,
ADSTYPE_BYTE,
ADSTYPE_BOOL,
ADSTYPE_SINT,
ADSTYPE_USINT,
ADSTYPE_DINT,
ADSTYPE_UDINT,
ADSTYPE_WORD,
ADSTYPE_DWORD,
ADSTYPE_REAL,
ADSTYPE_LREAL,
ADSTYPE_STRING,
ADSTYPE_TIME,
ADSTYPE_DATE,
ADSTYPE_DATE_AND_TIME,
ADSTYPE_TOD,
]
),
vol.Required(CONF_ADS_VALUE): vol.Coerce(int),
@@ -222,37 +255,53 @@ class AdsHub:
def _device_notification_callback(self, notification, name):
"""Handle device notifications."""
contents = notification.contents
hnotify = int(contents.hNotification)
_LOGGER.debug("Received notification %d", hnotify)
# get dynamically sized data array
# Get dynamically sized data array
data_size = contents.cbSampleSize
data = (ctypes.c_ubyte * data_size).from_address(
data_address = (
ctypes.addressof(contents)
+ pyads.structs.SAdsNotificationHeader.data.offset
)
data = (ctypes.c_ubyte * data_size).from_address(data_address)
try:
with self._lock:
notification_item = self._notification_items[hnotify]
except KeyError:
# Acquire notification item
with self._lock:
notification_item = self._notification_items.get(hnotify)
if not notification_item:
_LOGGER.error("Unknown device notification handle: %d", hnotify)
return
# Parse data to desired datatype
if notification_item.plc_datatype == pyads.PLCTYPE_BOOL:
# Data parsing based on PLC data type
plc_datatype = notification_item.plc_datatype
unpack_formats = {
pyads.PLCTYPE_BYTE: "<b",
pyads.PLCTYPE_INT: "<h",
pyads.PLCTYPE_UINT: "<H",
pyads.PLCTYPE_SINT: "<b",
pyads.PLCTYPE_USINT: "<B",
pyads.PLCTYPE_DINT: "<i",
pyads.PLCTYPE_UDINT: "<I",
pyads.PLCTYPE_WORD: "<H",
pyads.PLCTYPE_DWORD: "<I",
pyads.PLCTYPE_LREAL: "<d",
pyads.PLCTYPE_REAL: "<f",
pyads.PLCTYPE_TOD: "<i", # Treat as DINT
pyads.PLCTYPE_DATE: "<i", # Treat as DINT
pyads.PLCTYPE_DT: "<i", # Treat as DINT
pyads.PLCTYPE_TIME: "<i", # Treat as DINT
}
if plc_datatype == pyads.PLCTYPE_BOOL:
value = bool(struct.unpack("<?", bytearray(data))[0])
elif notification_item.plc_datatype == pyads.PLCTYPE_INT:
value = struct.unpack("<h", bytearray(data))[0]
elif notification_item.plc_datatype == pyads.PLCTYPE_BYTE:
value = struct.unpack("<B", bytearray(data))[0]
elif notification_item.plc_datatype == pyads.PLCTYPE_UINT:
value = struct.unpack("<H", bytearray(data))[0]
elif notification_item.plc_datatype == pyads.PLCTYPE_DINT:
value = struct.unpack("<i", bytearray(data))[0]
elif notification_item.plc_datatype == pyads.PLCTYPE_UDINT:
value = struct.unpack("<I", bytearray(data))[0]
elif plc_datatype == pyads.PLCTYPE_STRING:
value = (
bytearray(data).split(b"\x00", 1)[0].decode("utf-8", errors="ignore")
)
elif plc_datatype in unpack_formats:
value = struct.unpack(unpack_formats[plc_datatype], bytearray(data))[0]
else:
value = bytearray(data)
_LOGGER.warning("No callback available for this datatype")

View File

@@ -2,18 +2,14 @@
from __future__ import annotations
from dataclasses import dataclass
from airgradient import AirGradientClient, get_model_name
from airgradient import AirGradientClient
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
from .coordinator import AirGradientConfigCoordinator, AirGradientMeasurementCoordinator
from .coordinator import AirGradientCoordinator
PLATFORMS: list[Platform] = [
Platform.BUTTON,
@@ -25,15 +21,7 @@ PLATFORMS: list[Platform] = [
]
@dataclass
class AirGradientData:
"""AirGradient data class."""
measurement: AirGradientMeasurementCoordinator
config: AirGradientConfigCoordinator
type AirGradientConfigEntry = ConfigEntry[AirGradientData]
type AirGradientConfigEntry = ConfigEntry[AirGradientCoordinator]
async def async_setup_entry(hass: HomeAssistant, entry: AirGradientConfigEntry) -> bool:
@@ -43,27 +31,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: AirGradientConfigEntry)
entry.data[CONF_HOST], session=async_get_clientsession(hass)
)
measurement_coordinator = AirGradientMeasurementCoordinator(hass, client)
config_coordinator = AirGradientConfigCoordinator(hass, client)
coordinator = AirGradientCoordinator(hass, client)
await measurement_coordinator.async_config_entry_first_refresh()
await config_coordinator.async_config_entry_first_refresh()
await coordinator.async_config_entry_first_refresh()
device_registry = dr.async_get(hass)
device_registry.async_get_or_create(
config_entry_id=entry.entry_id,
identifiers={(DOMAIN, measurement_coordinator.serial_number)},
manufacturer="AirGradient",
model=get_model_name(measurement_coordinator.data.model),
model_id=measurement_coordinator.data.model,
serial_number=measurement_coordinator.data.serial_number,
sw_version=measurement_coordinator.data.firmware_version,
)
entry.runtime_data = AirGradientData(
measurement=measurement_coordinator,
config=config_coordinator,
)
entry.runtime_data = coordinator
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

View File

@@ -15,8 +15,9 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import DOMAIN, AirGradientConfigEntry
from .coordinator import AirGradientConfigCoordinator
from . import AirGradientConfigEntry
from .const import DOMAIN
from .coordinator import AirGradientCoordinator
from .entity import AirGradientEntity
@@ -47,8 +48,8 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AirGradient button entities based on a config entry."""
model = entry.runtime_data.measurement.data.model
coordinator = entry.runtime_data.config
coordinator = entry.runtime_data
model = coordinator.data.measures.model
added_entities = False
@@ -57,7 +58,7 @@ async def async_setup_entry(
nonlocal added_entities
if (
coordinator.data.configuration_control is ConfigurationControl.LOCAL
coordinator.data.config.configuration_control is ConfigurationControl.LOCAL
and not added_entities
):
entities = [AirGradientButton(coordinator, CO2_CALIBRATION)]
@@ -67,7 +68,8 @@ async def async_setup_entry(
async_add_entities(entities)
added_entities = True
elif (
coordinator.data.configuration_control is not ConfigurationControl.LOCAL
coordinator.data.config.configuration_control
is not ConfigurationControl.LOCAL
and added_entities
):
entity_registry = er.async_get(hass)
@@ -87,11 +89,10 @@ class AirGradientButton(AirGradientEntity, ButtonEntity):
"""Defines an AirGradient button."""
entity_description: AirGradientButtonEntityDescription
coordinator: AirGradientConfigCoordinator
def __init__(
self,
coordinator: AirGradientConfigCoordinator,
coordinator: AirGradientCoordinator,
description: AirGradientButtonEntityDescription,
) -> None:
"""Initialize airgradient button."""

View File

@@ -2,6 +2,7 @@
from __future__ import annotations
from dataclasses import dataclass
from datetime import timedelta
from typing import TYPE_CHECKING
@@ -16,7 +17,15 @@ if TYPE_CHECKING:
from . import AirGradientConfigEntry
class AirGradientCoordinator[_DataT](DataUpdateCoordinator[_DataT]):
@dataclass
class AirGradientData:
"""Class for AirGradient data."""
measures: Measures
config: Config
class AirGradientCoordinator(DataUpdateCoordinator[AirGradientData]):
"""Class to manage fetching AirGradient data."""
config_entry: AirGradientConfigEntry
@@ -33,25 +42,11 @@ class AirGradientCoordinator[_DataT](DataUpdateCoordinator[_DataT]):
assert self.config_entry.unique_id
self.serial_number = self.config_entry.unique_id
async def _async_update_data(self) -> _DataT:
async def _async_update_data(self) -> AirGradientData:
try:
return await self._update_data()
measures = await self.client.get_current_measures()
config = await self.client.get_config()
except AirGradientError as error:
raise UpdateFailed(error) from error
async def _update_data(self) -> _DataT:
raise NotImplementedError
class AirGradientMeasurementCoordinator(AirGradientCoordinator[Measures]):
"""Class to manage fetching AirGradient data."""
async def _update_data(self) -> Measures:
return await self.client.get_current_measures()
class AirGradientConfigCoordinator(AirGradientCoordinator[Config]):
"""Class to manage fetching AirGradient data."""
async def _update_data(self) -> Config:
return await self.client.get_config()
else:
return AirGradientData(measures, config)

View File

@@ -1,5 +1,7 @@
"""Base class for AirGradient entities."""
from airgradient import get_model_name
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
@@ -15,6 +17,12 @@ class AirGradientEntity(CoordinatorEntity[AirGradientCoordinator]):
def __init__(self, coordinator: AirGradientCoordinator) -> None:
"""Initialize airgradient entity."""
super().__init__(coordinator)
measures = coordinator.data.measures
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, coordinator.serial_number)},
manufacturer="AirGradient",
model=get_model_name(measures.model),
model_id=measures.model,
serial_number=coordinator.serial_number,
sw_version=measures.firmware_version,
)

View File

@@ -18,7 +18,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AirGradientConfigEntry
from .const import DOMAIN
from .coordinator import AirGradientConfigCoordinator
from .coordinator import AirGradientCoordinator
from .entity import AirGradientEntity
@@ -62,8 +62,8 @@ async def async_setup_entry(
) -> None:
"""Set up AirGradient number entities based on a config entry."""
model = entry.runtime_data.measurement.data.model
coordinator = entry.runtime_data.config
coordinator = entry.runtime_data
model = coordinator.data.measures.model
added_entities = False
@@ -72,7 +72,7 @@ async def async_setup_entry(
nonlocal added_entities
if (
coordinator.data.configuration_control is ConfigurationControl.LOCAL
coordinator.data.config.configuration_control is ConfigurationControl.LOCAL
and not added_entities
):
entities = []
@@ -84,7 +84,8 @@ async def async_setup_entry(
async_add_entities(entities)
added_entities = True
elif (
coordinator.data.configuration_control is not ConfigurationControl.LOCAL
coordinator.data.config.configuration_control
is not ConfigurationControl.LOCAL
and added_entities
):
entity_registry = er.async_get(hass)
@@ -104,11 +105,10 @@ class AirGradientNumber(AirGradientEntity, NumberEntity):
"""Defines an AirGradient number entity."""
entity_description: AirGradientNumberEntityDescription
coordinator: AirGradientConfigCoordinator
def __init__(
self,
coordinator: AirGradientConfigCoordinator,
coordinator: AirGradientCoordinator,
description: AirGradientNumberEntityDescription,
) -> None:
"""Initialize AirGradient number."""
@@ -119,7 +119,7 @@ class AirGradientNumber(AirGradientEntity, NumberEntity):
@property
def native_value(self) -> int | None:
"""Return the state of the number."""
return self.entity_description.value_fn(self.coordinator.data)
return self.entity_description.value_fn(self.coordinator.data.config)
async def async_set_native_value(self, value: float) -> None:
"""Set the selected value."""

View File

@@ -18,7 +18,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AirGradientConfigEntry
from .const import DOMAIN, PM_STANDARD, PM_STANDARD_REVERSE
from .coordinator import AirGradientConfigCoordinator
from .coordinator import AirGradientCoordinator
from .entity import AirGradientEntity
@@ -144,13 +144,11 @@ async def async_setup_entry(
) -> None:
"""Set up AirGradient select entities based on a config entry."""
coordinator = entry.runtime_data.config
measurement_coordinator = entry.runtime_data.measurement
coordinator = entry.runtime_data
model = coordinator.data.measures.model
async_add_entities([AirGradientSelect(coordinator, CONFIG_CONTROL_ENTITY)])
model = measurement_coordinator.data.model
added_entities = False
@callback
@@ -158,7 +156,7 @@ async def async_setup_entry(
nonlocal added_entities
if (
coordinator.data.configuration_control is ConfigurationControl.LOCAL
coordinator.data.config.configuration_control is ConfigurationControl.LOCAL
and not added_entities
):
entities: list[AirGradientSelect] = [
@@ -179,7 +177,8 @@ async def async_setup_entry(
async_add_entities(entities)
added_entities = True
elif (
coordinator.data.configuration_control is not ConfigurationControl.LOCAL
coordinator.data.config.configuration_control
is not ConfigurationControl.LOCAL
and added_entities
):
entity_registry = er.async_get(hass)
@@ -201,11 +200,10 @@ class AirGradientSelect(AirGradientEntity, SelectEntity):
"""Defines an AirGradient select entity."""
entity_description: AirGradientSelectEntityDescription
coordinator: AirGradientConfigCoordinator
def __init__(
self,
coordinator: AirGradientConfigCoordinator,
coordinator: AirGradientCoordinator,
description: AirGradientSelectEntityDescription,
) -> None:
"""Initialize AirGradient select."""
@@ -216,7 +214,7 @@ class AirGradientSelect(AirGradientEntity, SelectEntity):
@property
def current_option(self) -> str | None:
"""Return the state of the select."""
return self.entity_description.value_fn(self.coordinator.data)
return self.entity_description.value_fn(self.coordinator.data.config)
async def async_select_option(self, option: str) -> None:
"""Change the selected option."""

View File

@@ -32,7 +32,7 @@ from homeassistant.helpers.typing import StateType
from . import AirGradientConfigEntry
from .const import PM_STANDARD, PM_STANDARD_REVERSE
from .coordinator import AirGradientConfigCoordinator, AirGradientMeasurementCoordinator
from .coordinator import AirGradientCoordinator
from .entity import AirGradientEntity
@@ -218,7 +218,7 @@ async def async_setup_entry(
) -> None:
"""Set up AirGradient sensor entities based on a config entry."""
coordinator = entry.runtime_data.measurement
coordinator = entry.runtime_data
listener: Callable[[], None] | None = None
not_setup: set[AirGradientMeasurementSensorEntityDescription] = set(
MEASUREMENT_SENSOR_TYPES
@@ -232,7 +232,7 @@ async def async_setup_entry(
not_setup = set()
sensors = []
for description in sensor_descriptions:
if description.value_fn(coordinator.data) is None:
if description.value_fn(coordinator.data.measures) is None:
not_setup.add(description)
else:
sensors.append(AirGradientMeasurementSensor(coordinator, description))
@@ -248,64 +248,65 @@ async def async_setup_entry(
add_entities()
entities = [
AirGradientConfigSensor(entry.runtime_data.config, description)
AirGradientConfigSensor(coordinator, description)
for description in CONFIG_SENSOR_TYPES
]
if "L" in coordinator.data.model:
if "L" in coordinator.data.measures.model:
entities.extend(
AirGradientConfigSensor(entry.runtime_data.config, description)
AirGradientConfigSensor(coordinator, description)
for description in CONFIG_LED_BAR_SENSOR_TYPES
)
if "I" in coordinator.data.model:
if "I" in coordinator.data.measures.model:
entities.extend(
AirGradientConfigSensor(entry.runtime_data.config, description)
AirGradientConfigSensor(coordinator, description)
for description in CONFIG_DISPLAY_SENSOR_TYPES
)
async_add_entities(entities)
class AirGradientMeasurementSensor(AirGradientEntity, SensorEntity):
class AirGradientSensor(AirGradientEntity, SensorEntity):
"""Defines an AirGradient sensor."""
entity_description: AirGradientMeasurementSensorEntityDescription
coordinator: AirGradientMeasurementCoordinator
def __init__(
self,
coordinator: AirGradientMeasurementCoordinator,
description: AirGradientMeasurementSensorEntityDescription,
coordinator: AirGradientCoordinator,
description: SensorEntityDescription,
) -> None:
"""Initialize airgradient sensor."""
super().__init__(coordinator)
self.entity_description = description
self._attr_unique_id = f"{coordinator.serial_number}-{description.key}"
class AirGradientMeasurementSensor(AirGradientSensor):
"""Defines an AirGradient sensor."""
entity_description: AirGradientMeasurementSensorEntityDescription
@property
def native_value(self) -> StateType:
"""Return the state of the sensor."""
return self.entity_description.value_fn(self.coordinator.data)
return self.entity_description.value_fn(self.coordinator.data.measures)
class AirGradientConfigSensor(AirGradientEntity, SensorEntity):
class AirGradientConfigSensor(AirGradientSensor):
"""Defines an AirGradient sensor."""
entity_description: AirGradientConfigSensorEntityDescription
coordinator: AirGradientConfigCoordinator
def __init__(
self,
coordinator: AirGradientConfigCoordinator,
coordinator: AirGradientCoordinator,
description: AirGradientConfigSensorEntityDescription,
) -> None:
"""Initialize airgradient sensor."""
super().__init__(coordinator)
self.entity_description = description
self._attr_unique_id = f"{coordinator.serial_number}-{description.key}"
super().__init__(coordinator, description)
self._attr_entity_registry_enabled_default = (
coordinator.data.configuration_control is not ConfigurationControl.LOCAL
coordinator.data.config.configuration_control
is not ConfigurationControl.LOCAL
)
@property
def native_value(self) -> StateType:
"""Return the state of the sensor."""
return self.entity_description.value_fn(self.coordinator.data)
return self.entity_description.value_fn(self.coordinator.data.config)

View File

@@ -19,7 +19,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AirGradientConfigEntry
from .const import DOMAIN
from .coordinator import AirGradientConfigCoordinator
from .coordinator import AirGradientCoordinator
from .entity import AirGradientEntity
@@ -46,7 +46,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AirGradient switch entities based on a config entry."""
coordinator = entry.runtime_data.config
coordinator = entry.runtime_data
added_entities = False
@@ -55,7 +55,7 @@ async def async_setup_entry(
nonlocal added_entities
if (
coordinator.data.configuration_control is ConfigurationControl.LOCAL
coordinator.data.config.configuration_control is ConfigurationControl.LOCAL
and not added_entities
):
async_add_entities(
@@ -63,7 +63,8 @@ async def async_setup_entry(
)
added_entities = True
elif (
coordinator.data.configuration_control is not ConfigurationControl.LOCAL
coordinator.data.config.configuration_control
is not ConfigurationControl.LOCAL
and added_entities
):
entity_registry = er.async_get(hass)
@@ -82,11 +83,10 @@ class AirGradientSwitch(AirGradientEntity, SwitchEntity):
"""Defines an AirGradient switch entity."""
entity_description: AirGradientSwitchEntityDescription
coordinator: AirGradientConfigCoordinator
def __init__(
self,
coordinator: AirGradientConfigCoordinator,
coordinator: AirGradientCoordinator,
description: AirGradientSwitchEntityDescription,
) -> None:
"""Initialize AirGradient switch."""
@@ -97,7 +97,7 @@ class AirGradientSwitch(AirGradientEntity, SwitchEntity):
@property
def is_on(self) -> bool:
"""Return the state of the switch."""
return self.entity_description.value_fn(self.coordinator.data)
return self.entity_description.value_fn(self.coordinator.data.config)
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the switch on."""

View File

@@ -7,7 +7,7 @@ from homeassistant.components.update import UpdateDeviceClass, UpdateEntity
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AirGradientConfigEntry, AirGradientMeasurementCoordinator
from . import AirGradientConfigEntry, AirGradientCoordinator
from .entity import AirGradientEntity
SCAN_INTERVAL = timedelta(hours=1)
@@ -20,18 +20,17 @@ async def async_setup_entry(
) -> None:
"""Set up Airgradient update platform."""
data = config_entry.runtime_data
coordinator = config_entry.runtime_data
async_add_entities([AirGradientUpdate(data.measurement)], True)
async_add_entities([AirGradientUpdate(coordinator)], True)
class AirGradientUpdate(AirGradientEntity, UpdateEntity):
"""Representation of Airgradient Update."""
_attr_device_class = UpdateDeviceClass.FIRMWARE
coordinator: AirGradientMeasurementCoordinator
def __init__(self, coordinator: AirGradientMeasurementCoordinator) -> None:
def __init__(self, coordinator: AirGradientCoordinator) -> None:
"""Initialize the entity."""
super().__init__(coordinator)
self._attr_unique_id = f"{coordinator.serial_number}-update"
@@ -44,7 +43,7 @@ class AirGradientUpdate(AirGradientEntity, UpdateEntity):
@property
def installed_version(self) -> str:
"""Return the installed version of the entity."""
return self.coordinator.data.firmware_version
return self.coordinator.data.measures.firmware_version
async def async_update(self) -> None:
"""Update the entity."""

View File

@@ -262,7 +262,7 @@ class Airtouch5AC(Airtouch5ClimateEntity):
_LOGGER.debug("Argument `temperature` is missing in set_temperature")
return
await self._control(temp=temp)
await self._control(setpoint=SetpointControl.CHANGE_SETPOINT, temp=temp)
class Airtouch5Zone(Airtouch5ClimateEntity):

View File

@@ -53,6 +53,8 @@ from .const import (
LOGGER,
)
type AirVisualConfigEntry = ConfigEntry[DataUpdateCoordinator]
# We use a raw string for the airvisual_pro domain (instead of importing the actual
# constant) so that we can avoid listing it as a dependency:
DOMAIN_AIRVISUAL_PRO = "airvisual_pro"
@@ -91,10 +93,9 @@ def async_get_cloud_coordinators_by_api_key(
) -> list[DataUpdateCoordinator]:
"""Get all DataUpdateCoordinator objects related to a particular API key."""
return [
coordinator
for entry_id, coordinator in hass.data[DOMAIN].items()
if (entry := hass.config_entries.async_get_entry(entry_id))
and entry.data.get(CONF_API_KEY) == api_key
entry.runtime_data
for entry in hass.config_entries.async_entries(DOMAIN)
if entry.data.get(CONF_API_KEY) == api_key and hasattr(entry, "runtime_data")
]
@@ -172,7 +173,7 @@ def _standardize_geography_config_entry(
hass.config_entries.async_update_entry(entry, **entry_updates)
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: AirVisualConfigEntry) -> bool:
"""Set up AirVisual as config entry."""
if CONF_API_KEY not in entry.data:
# If this is a migrated AirVisual Pro entry, there's no actual setup to do;
@@ -220,8 +221,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry.async_on_unload(entry.add_update_listener(async_reload_entry))
await coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = coordinator
entry.runtime_data = coordinator
# Reassess the interval between 2 server requests
async_sync_geo_coordinator_update_intervals(hass, entry.data[CONF_API_KEY])
@@ -231,7 +231,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_migrate_entry(hass: HomeAssistant, entry: AirVisualConfigEntry) -> bool:
"""Migrate an old config entry."""
version = entry.version
@@ -388,21 +388,19 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: AirVisualConfigEntry) -> bool:
"""Unload an AirVisual config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
if CONF_API_KEY in entry.data:
# Re-calculate the update interval period for any remaining consumers of
# this API key:
async_sync_geo_coordinator_update_intervals(hass, entry.data[CONF_API_KEY])
if unload_ok and CONF_API_KEY in entry.data:
# Re-calculate the update interval period for any remaining consumers of
# this API key:
async_sync_geo_coordinator_update_intervals(hass, entry.data[CONF_API_KEY])
return unload_ok
async def async_reload_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:
async def async_reload_entry(hass: HomeAssistant, entry: AirVisualConfigEntry) -> None:
"""Handle an options update."""
await hass.config_entries.async_reload(entry.entry_id)

View File

@@ -5,7 +5,6 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_COUNTRY,
@@ -15,9 +14,9 @@ from homeassistant.const import (
CONF_UNIQUE_ID,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import CONF_CITY, DOMAIN
from . import AirVisualConfigEntry
from .const import CONF_CITY
CONF_COORDINATES = "coordinates"
CONF_TITLE = "title"
@@ -37,10 +36,10 @@ TO_REDACT = {
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, entry: ConfigEntry
hass: HomeAssistant, entry: AirVisualConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
coordinator: DataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
coordinator = entry.runtime_data
return {
"entry": async_redact_data(entry.as_dict(), TO_REDACT),

View File

@@ -26,8 +26,8 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from . import AirVisualEntity
from .const import CONF_CITY, DOMAIN
from . import AirVisualConfigEntry, AirVisualEntity
from .const import CONF_CITY
ATTR_CITY = "city"
ATTR_COUNTRY = "country"
@@ -105,10 +105,12 @@ POLLUTANT_UNITS = {
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
hass: HomeAssistant,
entry: AirVisualConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AirVisual sensors based on a config entry."""
coordinator = hass.data[DOMAIN][entry.entry_id]
coordinator = entry.runtime_data
async_add_entities(
AirVisualGeographySensor(coordinator, entry, description, locale)
for locale in GEOGRAPHY_SENSOR_LOCALES

View File

@@ -11,5 +11,5 @@
"documentation": "https://www.home-assistant.io/integrations/airzone",
"iot_class": "local_polling",
"loggers": ["aioairzone"],
"requirements": ["aioairzone==0.8.2"]
"requirements": ["aioairzone==0.9.1"]
}

View File

@@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/airzone_cloud",
"iot_class": "cloud_push",
"loggers": ["aioairzone_cloud"],
"requirements": ["aioairzone-cloud==0.6.2"]
"requirements": ["aioairzone-cloud==0.6.5"]
}

View File

@@ -12,7 +12,16 @@ from aioairzone_cloud.const import (
AZD_AQ_PM_10,
AZD_CPU_USAGE,
AZD_HUMIDITY,
AZD_INDOOR_EXCHANGER_TEMP,
AZD_INDOOR_RETURN_TEMP,
AZD_INDOOR_WORK_TEMP,
AZD_MEMORY_FREE,
AZD_OUTDOOR_CONDENSER_PRESS,
AZD_OUTDOOR_DISCHARGE_TEMP,
AZD_OUTDOOR_ELECTRIC_CURRENT,
AZD_OUTDOOR_EVAPORATOR_PRESS,
AZD_OUTDOOR_EXCHANGER_TEMP,
AZD_OUTDOOR_TEMP,
AZD_TEMP,
AZD_THERMOSTAT_BATTERY,
AZD_THERMOSTAT_COVERAGE,
@@ -32,7 +41,9 @@ from homeassistant.const import (
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
EntityCategory,
UnitOfElectricCurrent,
UnitOfInformation,
UnitOfPressure,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant, callback
@@ -48,6 +59,78 @@ from .entity import (
)
AIDOO_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_INDOOR_EXCHANGER_TEMP,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
translation_key="indoor_exchanger_temp",
),
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_INDOOR_RETURN_TEMP,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
translation_key="indoor_return_temp",
),
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_INDOOR_WORK_TEMP,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
translation_key="indoor_work_temp",
),
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_OUTDOOR_CONDENSER_PRESS,
native_unit_of_measurement=UnitOfPressure.KPA,
state_class=SensorStateClass.MEASUREMENT,
translation_key="outdoor_condenser_press",
),
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_OUTDOOR_DISCHARGE_TEMP,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
translation_key="outdoor_discharge_temp",
),
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_OUTDOOR_ELECTRIC_CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
translation_key="outdoor_electric_current",
),
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_OUTDOOR_EVAPORATOR_PRESS,
native_unit_of_measurement=UnitOfPressure.KPA,
state_class=SensorStateClass.MEASUREMENT,
translation_key="outdoor_evaporator_press",
),
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_OUTDOOR_EXCHANGER_TEMP,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
translation_key="outdoor_exchanger_temp",
),
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_OUTDOOR_TEMP,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
translation_key="outdoor_temp",
),
SensorEntityDescription(
device_class=SensorDeviceClass.TEMPERATURE,
key=AZD_TEMP,

View File

@@ -45,6 +45,33 @@
"free_memory": {
"name": "Free memory"
},
"indoor_exchanger_temp": {
"name": "Indoor exchanger temperature"
},
"indoor_return_temp": {
"name": "Indoor return temperature"
},
"indoor_work_temp": {
"name": "Indoor working temperature"
},
"outdoor_condenser_press": {
"name": "Outdoor condenser pressure"
},
"outdoor_discharge_temp": {
"name": "Outdoor discharge temperature"
},
"outdoor_electric_current": {
"name": "Outdoor electric current"
},
"outdoor_evaporator_press": {
"name": "Outdoor evaporator pressure"
},
"outdoor_exchanger_temp": {
"name": "Outdoor exchanger temperature"
},
"outdoor_temp": {
"name": "Outdoor temperature"
},
"thermostat_coverage": {
"name": "Signal percentage"
}

View File

@@ -2,6 +2,7 @@
from __future__ import annotations
from collections import defaultdict
import logging
from typing import Any, Final
@@ -114,6 +115,8 @@ def get_engine(
all_voices: dict[str, dict[str, str]] = {}
all_engines: dict[str, set[str]] = defaultdict(set)
all_voices_req = polly_client.describe_voices()
for voice in all_voices_req.get("Voices", []):
@@ -124,8 +127,12 @@ def get_engine(
language_code: str | None = voice.get("LanguageCode")
if language_code is not None and language_code not in supported_languages:
supported_languages.append(language_code)
for engine in voice.get("SupportedEngines"):
all_engines[engine].add(voice_id)
return AmazonPollyProvider(polly_client, config, supported_languages, all_voices)
return AmazonPollyProvider(
polly_client, config, supported_languages, all_voices, all_engines
)
class AmazonPollyProvider(Provider):
@@ -137,13 +144,16 @@ class AmazonPollyProvider(Provider):
config: ConfigType,
supported_languages: list[str],
all_voices: dict[str, dict[str, str]],
all_engines: dict[str, set[str]],
) -> None:
"""Initialize Amazon Polly provider for TTS."""
self.client = polly_client
self.config = config
self.supported_langs = supported_languages
self.all_voices = all_voices
self.all_engines = all_engines
self.default_voice: str = self.config[CONF_VOICE]
self.default_engine: str = self.config[CONF_ENGINE]
self.name = "Amazon Polly"
@property
@@ -159,12 +169,12 @@ class AmazonPollyProvider(Provider):
@property
def default_options(self) -> dict[str, str]:
"""Return dict include default options."""
return {CONF_VOICE: self.default_voice}
return {CONF_VOICE: self.default_voice, CONF_ENGINE: self.default_engine}
@property
def supported_options(self) -> list[str]:
"""Return a list of supported options."""
return [CONF_VOICE]
return [CONF_VOICE, CONF_ENGINE]
def get_tts_audio(
self,
@@ -179,9 +189,14 @@ class AmazonPollyProvider(Provider):
_LOGGER.error("%s does not support the %s language", voice_id, language)
return None, None
engine = options.get(CONF_ENGINE, self.default_engine)
if voice_id not in self.all_engines[engine]:
_LOGGER.error("%s does not support the %s engine", voice_id, engine)
return None, None
_LOGGER.debug("Requesting TTS file for text: %s", message)
resp = self.client.synthesize_speech(
Engine=self.config[CONF_ENGINE],
Engine=engine,
OutputFormat=self.config[CONF_OUTPUT_FORMAT],
SampleRate=self.config[CONF_SAMPLE_RATE],
Text=message,

View File

@@ -7,11 +7,13 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_TOKEN
from homeassistant.core import HomeAssistant
from .const import CONF_SITE_ID, DOMAIN, PLATFORMS
from .const import CONF_SITE_ID, PLATFORMS
from .coordinator import AmberUpdateCoordinator
type AmberConfigEntry = ConfigEntry[AmberUpdateCoordinator]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: AmberConfigEntry) -> bool:
"""Set up Amber Electric from a config entry."""
configuration = Configuration(access_token=entry.data[CONF_API_TOKEN])
api_instance = amber_api.AmberApi.create(configuration)
@@ -19,15 +21,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
coordinator = AmberUpdateCoordinator(hass, api_instance, site_id)
await coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = coordinator
entry.runtime_data = coordinator
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: AmberConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -8,12 +8,12 @@ from homeassistant.components.binary_sensor import (
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTRIBUTION, DOMAIN
from . import AmberConfigEntry
from .const import ATTRIBUTION
from .coordinator import AmberUpdateCoordinator
PRICE_SPIKE_ICONS = {
@@ -85,11 +85,11 @@ class AmberDemandWindowBinarySensor(AmberPriceGridSensor):
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
entry: AmberConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up a config entry."""
coordinator: AmberUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
coordinator = entry.runtime_data
price_spike_description = BinarySensorEntityDescription(
key="price_spike",

View File

@@ -17,13 +17,13 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CURRENCY_DOLLAR, PERCENTAGE, UnitOfEnergy
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTRIBUTION, DOMAIN
from . import AmberConfigEntry
from .const import ATTRIBUTION
from .coordinator import AmberUpdateCoordinator, normalize_descriptor
UNIT = f"{CURRENCY_DOLLAR}/{UnitOfEnergy.KILO_WATT_HOUR}"
@@ -196,11 +196,11 @@ class AmberGridSensor(CoordinatorEntity[AmberUpdateCoordinator], SensorEntity):
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
entry: AmberConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up a config entry."""
coordinator: AmberUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
coordinator = entry.runtime_data
current: dict[str, CurrentInterval] = coordinator.data["current"]
forecasts: dict[str, list[ForecastInterval]] = coordinator.data["forecasts"]

View File

@@ -8,28 +8,30 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .const import DOMAIN
from .coordinator import AmbientNetworkDataUpdateCoordinator
type AmbientNetworkConfigEntry = ConfigEntry[AmbientNetworkDataUpdateCoordinator]
PLATFORMS: list[Platform] = [Platform.SENSOR]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(
hass: HomeAssistant, entry: AmbientNetworkConfigEntry
) -> bool:
"""Set up the Ambient Weather Network from a config entry."""
api = OpenAPI()
coordinator = AmbientNetworkDataUpdateCoordinator(hass, api)
await coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = coordinator
entry.runtime_data = coordinator
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(
hass: HomeAssistant, entry: AmbientNetworkConfigEntry
) -> bool:
"""Unload a config entry."""
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -10,7 +10,6 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_MILLION,
@@ -29,7 +28,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import dt as dt_util
from .const import DOMAIN
from . import AmbientNetworkConfigEntry
from .coordinator import AmbientNetworkDataUpdateCoordinator
from .entity import AmbientNetworkEntity
@@ -271,12 +270,12 @@ SENSOR_DESCRIPTIONS = (
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
entry: AmbientNetworkConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Ambient Network sensor entities."""
coordinator: AmbientNetworkDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
coordinator = entry.runtime_data
if coordinator.config_entry is not None:
async_add_entities(
AmbientNetworkSensor(

View File

@@ -8,6 +8,6 @@
"iot_class": "local_push",
"loggers": ["androidtvremote2"],
"quality_scale": "platinum",
"requirements": ["androidtvremote2==0.1.1"],
"requirements": ["androidtvremote2==0.1.2"],
"zeroconf": ["_androidtvremote2._tcp.local."]
}

View File

@@ -13,22 +13,20 @@ from anova_wifi import (
WebsocketFailure,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import aiohttp_client
from .const import DOMAIN
from .coordinator import AnovaCoordinator
from .models import AnovaData
from .models import AnovaConfigEntry, AnovaData
PLATFORMS = [Platform.SENSOR]
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: AnovaConfigEntry) -> bool:
"""Set up Anova from a config entry."""
api = AnovaApi(
aiohttp_client.async_get_clientsession(hass),
@@ -62,17 +60,14 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
assert api.websocket_handler is not None
devices = list(api.websocket_handler.devices.values())
coordinators = [AnovaCoordinator(hass, device) for device in devices]
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = AnovaData(
api_jwt=api.jwt, coordinators=coordinators, api=api
)
entry.runtime_data = AnovaData(api_jwt=api.jwt, coordinators=coordinators, api=api)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: AnovaConfigEntry) -> bool:
"""Unload a config entry."""
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
anova_data: AnovaData = hass.data[DOMAIN].pop(entry.entry_id)
# Disconnect from WS
await anova_data.api.disconnect_websocket()
await entry.runtime_data.api.disconnect_websocket()
return unload_ok

View File

@@ -4,8 +4,12 @@ from dataclasses import dataclass
from anova_wifi import AnovaApi
from homeassistant.config_entries import ConfigEntry
from .coordinator import AnovaCoordinator
type AnovaConfigEntry = ConfigEntry[AnovaData]
@dataclass
class AnovaData:

View File

@@ -7,7 +7,6 @@ from dataclasses import dataclass
from anova_wifi import AnovaMode, AnovaState, APCUpdateSensor
from homeassistant import config_entries
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
@@ -19,10 +18,9 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
from .const import DOMAIN
from .coordinator import AnovaCoordinator
from .entity import AnovaDescriptionEntity
from .models import AnovaData
from .models import AnovaConfigEntry
@dataclass(frozen=True, kw_only=True)
@@ -99,11 +97,11 @@ SENSOR_DESCRIPTIONS: list[AnovaSensorEntityDescription] = [
async def async_setup_entry(
hass: HomeAssistant,
entry: config_entries.ConfigEntry,
entry: AnovaConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up Anova device."""
anova_data: AnovaData = hass.data[DOMAIN][entry.entry_id]
anova_data = entry.runtime_data
for coordinator in anova_data.coordinators:
setup_coordinator(coordinator, async_add_entities)

View File

@@ -13,14 +13,16 @@ from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.dispatcher import async_dispatcher_send
from .const import ANTHEMAV_UPDATE_SIGNAL, DEVICE_TIMEOUT_SECONDS, DOMAIN
from .const import ANTHEMAV_UPDATE_SIGNAL, DEVICE_TIMEOUT_SECONDS
type AnthemavConfigEntry = ConfigEntry[anthemav.Connection]
PLATFORMS = [Platform.MEDIA_PLAYER]
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: AnthemavConfigEntry) -> bool:
"""Set up Anthem A/V Receivers from a config entry."""
@callback
@@ -41,7 +43,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
except (OSError, DeviceError) as err:
raise ConfigEntryNotReady from err
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = avr
entry.runtime_data = avr
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
@@ -56,16 +58,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: AnthemavConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
avr = hass.data[DOMAIN][entry.entry_id]
avr = entry.runtime_data
_LOGGER.debug("Close avr connection")
avr.close()
if avr is not None:
_LOGGER.debug("Close avr connection")
avr.close()
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok

View File

@@ -4,7 +4,6 @@ from __future__ import annotations
import logging
from anthemav.connection import Connection
from anthemav.protocol import AVR
from homeassistant.components.media_player import (
@@ -13,13 +12,13 @@ from homeassistant.components.media_player import (
MediaPlayerEntityFeature,
MediaPlayerState,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_MAC, CONF_MODEL
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AnthemavConfigEntry
from .const import ANTHEMAV_UPDATE_SIGNAL, DOMAIN, MANUFACTURER
_LOGGER = logging.getLogger(__name__)
@@ -27,7 +26,7 @@ _LOGGER = logging.getLogger(__name__)
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AnthemavConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up entry."""
@@ -35,7 +34,7 @@ async def async_setup_entry(
mac_address = config_entry.data[CONF_MAC]
model = config_entry.data[CONF_MODEL]
avr: Connection = hass.data[DOMAIN][config_entry.entry_id]
avr = config_entry.runtime_data
_LOGGER.debug("Connection data dump: %s", avr.dump_conndata)

View File

@@ -8,7 +8,7 @@ LOGGER = logging.getLogger(__package__)
CONF_RECOMMENDED = "recommended"
CONF_PROMPT = "prompt"
CONF_CHAT_MODEL = "chat_model"
RECOMMENDED_CHAT_MODEL = "claude-3-5-sonnet-20240620"
RECOMMENDED_CHAT_MODEL = "claude-3-haiku-20240307"
CONF_MAX_TOKENS = "max_tokens"
RECOMMENDED_MAX_TOKENS = 1024
CONF_TEMPERATURE = "temperature"

View File

@@ -16,6 +16,8 @@ from .coordinator import AOSmithEnergyCoordinator, AOSmithStatusCoordinator
PLATFORMS: list[Platform] = [Platform.SENSOR, Platform.WATER_HEATER]
type AOSmithConfigEntry = ConfigEntry[AOSmithData]
@dataclass
class AOSmithData:
@@ -26,7 +28,7 @@ class AOSmithData:
energy_coordinator: AOSmithEnergyCoordinator
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: AOSmithConfigEntry) -> bool:
"""Set up A. O. Smith from a config entry."""
email = entry.data[CONF_EMAIL]
password = entry.data[CONF_PASSWORD]
@@ -55,7 +57,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
await energy_coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = AOSmithData(
entry.runtime_data = AOSmithData(
client,
status_coordinator,
energy_coordinator,
@@ -66,9 +68,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: AOSmithConfigEntry) -> bool:
"""Unload a config entry."""
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -5,11 +5,9 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from . import AOSmithData
from .const import DOMAIN
from . import AOSmithConfigEntry
TO_REDACT = {
"address",
@@ -31,10 +29,10 @@ TO_REDACT = {
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
hass: HomeAssistant, config_entry: AOSmithConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
data: AOSmithData = hass.data[DOMAIN][config_entry.entry_id]
data = config_entry.runtime_data
all_device_info = await data.client.get_all_device_info()
return async_redact_data(all_device_info, TO_REDACT)

View File

@@ -11,13 +11,11 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import UnitOfEnergy
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AOSmithData
from .const import DOMAIN
from . import AOSmithConfigEntry
from .coordinator import AOSmithEnergyCoordinator, AOSmithStatusCoordinator
from .entity import AOSmithEnergyEntity, AOSmithStatusEntity
@@ -49,10 +47,12 @@ HOT_WATER_STATUS_MAP: dict[HotWaterStatus, str] = {
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
hass: HomeAssistant,
entry: AOSmithConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up A. O. Smith sensor platform."""
data: AOSmithData = hass.data[DOMAIN][entry.entry_id]
data = entry.runtime_data
async_add_entities(
AOSmithStatusSensorEntity(data.status_coordinator, description, junction_id)

View File

@@ -12,14 +12,12 @@ from homeassistant.components.water_heater import (
WaterHeaterEntity,
WaterHeaterEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AOSmithData
from .const import DOMAIN
from . import AOSmithConfigEntry
from .coordinator import AOSmithStatusCoordinator
from .entity import AOSmithStatusEntity
@@ -46,10 +44,12 @@ DEFAULT_OPERATION_MODE_PRIORITY = [
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
hass: HomeAssistant,
entry: AOSmithConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up A. O. Smith water heater platform."""
data: AOSmithData = hass.data[DOMAIN][entry.entry_id]
data = entry.runtime_data
async_add_entities(
AOSmithWaterHeaterEntity(data.status_coordinator, junction_id)

View File

@@ -2,22 +2,22 @@
from __future__ import annotations
import logging
from typing import Final
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PORT, Platform
from homeassistant.core import HomeAssistant
from .const import DOMAIN
from .coordinator import APCUPSdCoordinator
_LOGGER = logging.getLogger(__name__)
type APCUPSdConfigEntry = ConfigEntry[APCUPSdCoordinator]
PLATFORMS: Final = (Platform.BINARY_SENSOR, Platform.SENSOR)
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
async def async_setup_entry(
hass: HomeAssistant, config_entry: APCUPSdConfigEntry
) -> bool:
"""Use config values to set up a function enabling status retrieval."""
host, port = config_entry.data[CONF_HOST], config_entry.data[CONF_PORT]
coordinator = APCUPSdCoordinator(hass, host, port)
@@ -25,17 +25,13 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
await coordinator.async_config_entry_first_refresh()
# Store the coordinator for later uses.
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][config_entry.entry_id] = coordinator
config_entry.runtime_data = coordinator
# Forward the config entries to the supported platforms.
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: APCUPSdConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok and DOMAIN in hass.data:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -2,24 +2,21 @@
from __future__ import annotations
import logging
from typing import Final
from homeassistant.components.binary_sensor import (
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from . import APCUPSdConfigEntry
from .coordinator import APCUPSdCoordinator
PARALLEL_UPDATES = 0
_LOGGER = logging.getLogger(__name__)
_DESCRIPTION = BinarySensorEntityDescription(
key="statflag",
translation_key="online_status",
@@ -30,11 +27,11 @@ _VALUE_ONLINE_MASK: Final = 0b1000
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: APCUPSdConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up an APCUPSd Online Status binary sensor."""
coordinator: APCUPSdCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data
# Do not create the binary sensor if APCUPSd does not provide STATFLAG field for us
# to determine the online status.

View File

@@ -5,19 +5,17 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import DOMAIN
from .coordinator import APCUPSdCoordinator, APCUPSdData
from . import APCUPSdConfigEntry
TO_REDACT = {"SERIALNO", "HOSTNAME"}
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, entry: ConfigEntry
hass: HomeAssistant, entry: APCUPSdConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
coordinator: APCUPSdCoordinator = hass.data[DOMAIN][entry.entry_id]
data: APCUPSdData = coordinator.data
coordinator = entry.runtime_data
data = coordinator.data
return async_redact_data(data, TO_REDACT)

View File

@@ -10,7 +10,6 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
PERCENTAGE,
UnitOfApparentPower,
@@ -25,7 +24,8 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN, LAST_S_TEST
from . import APCUPSdConfigEntry
from .const import LAST_S_TEST
from .coordinator import APCUPSdCoordinator
PARALLEL_UPDATES = 0
@@ -406,11 +406,11 @@ INFERRED_UNITS = {
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: APCUPSdConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the APCUPSd sensors from config entries."""
coordinator: APCUPSdCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data
# The resource keys in the data dict collected in the coordinator is in upper-case
# by default, but we use lower cases throughout this integration.

View File

@@ -7,7 +7,7 @@
"documentation": "https://www.home-assistant.io/integrations/apple_tv",
"iot_class": "local_push",
"loggers": ["pyatv", "srptools"],
"requirements": ["pyatv==0.15.0"],
"requirements": ["pyatv==0.15.1"],
"zeroconf": [
"_mediaremotetv._tcp.local.",
"_companion-link._tcp.local.",

View File

@@ -36,10 +36,11 @@ class ApSystemsDataCoordinator(DataUpdateCoordinator[ApSystemsSensorData]):
async def _async_setup(self) -> None:
try:
max_power = (await self.api.get_device_info()).maxPower
device_info = await self.api.get_device_info()
except (ConnectionError, TimeoutError):
raise UpdateFailed from None
self.api.max_power = max_power
self.api.max_power = device_info.maxPower
self.api.min_power = device_info.minPower
async def _async_update_data(self) -> ApSystemsSensorData:
output_data = await self.api.get_output_data()

View File

@@ -26,7 +26,6 @@ async def async_setup_entry(
class ApSystemsMaxOutputNumber(ApSystemsEntity, NumberEntity):
"""Base sensor to be used with description."""
_attr_native_min_value = 30
_attr_native_step = 1
_attr_device_class = NumberDeviceClass.POWER
_attr_mode = NumberMode.BOX
@@ -42,6 +41,7 @@ class ApSystemsMaxOutputNumber(ApSystemsEntity, NumberEntity):
self._api = data.coordinator.api
self._attr_unique_id = f"{data.device_id}_output_limit"
self._attr_native_max_value = data.coordinator.api.max_power
self._attr_native_min_value = data.coordinator.api.min_power
async def async_update(self) -> None:
"""Set the state with the value fetched from the inverter."""

View File

@@ -56,7 +56,7 @@ class AquaCellConfigFlow(ConfigFlow, domain=DOMAIN):
refresh_token = await api.authenticate(
user_input[CONF_EMAIL], user_input[CONF_PASSWORD]
)
except ApiException:
except (ApiException, TimeoutError):
errors["base"] = "cannot_connect"
except AuthenticationFailed:
errors["base"] = "invalid_auth"

View File

@@ -56,7 +56,7 @@ class AquacellCoordinator(DataUpdateCoordinator[dict[str, Softener]]):
so entities can quickly look up their data.
"""
async with asyncio.timeout(10):
async with asyncio.timeout(30):
# Check if the refresh token is expired
expiry_time = (
self.refresh_token_creation_time
@@ -72,7 +72,7 @@ class AquacellCoordinator(DataUpdateCoordinator[dict[str, Softener]]):
softeners = await self.aquacell_api.get_all_softeners()
except AuthenticationFailed as err:
raise ConfigEntryError from err
except AquacellApiException as err:
except (AquacellApiException, TimeoutError) as err:
raise UpdateFailed(f"Error communicating with API: {err}") from err
return {softener.dsn: softener for softener in softeners}

View File

@@ -3,6 +3,7 @@
from __future__ import annotations
from collections.abc import AsyncIterable
from typing import Any
import voluptuous as vol
@@ -16,6 +17,7 @@ from .const import (
DATA_LAST_WAKE_UP,
DOMAIN,
EVENT_RECORDING,
OPTION_PREFERRED,
SAMPLE_CHANNELS,
SAMPLE_RATE,
SAMPLE_WIDTH,
@@ -57,6 +59,7 @@ __all__ = (
"PipelineNotFound",
"WakeWordSettings",
"EVENT_RECORDING",
"OPTION_PREFERRED",
"SAMPLES_PER_CHUNK",
"SAMPLE_RATE",
"SAMPLE_WIDTH",
@@ -99,7 +102,7 @@ async def async_pipeline_from_audio_stream(
wake_word_phrase: str | None = None,
pipeline_id: str | None = None,
conversation_id: str | None = None,
tts_audio_output: str | None = None,
tts_audio_output: str | dict[str, Any] | None = None,
wake_word_settings: WakeWordSettings | None = None,
audio_settings: AudioSettings | None = None,
device_id: str | None = None,

View File

@@ -22,3 +22,5 @@ SAMPLE_CHANNELS = 1 # mono
MS_PER_CHUNK = 10
SAMPLES_PER_CHUNK = SAMPLE_RATE // (1000 // MS_PER_CHUNK) # 10 ms @ 16Khz
BYTES_PER_CHUNK = SAMPLES_PER_CHUNK * SAMPLE_WIDTH * SAMPLE_CHANNELS # 16-bit
OPTION_PREFERRED = "preferred"

View File

@@ -504,7 +504,7 @@ class AudioSettings:
is_vad_enabled: bool = True
"""True if VAD is used to determine the end of the voice command."""
silence_seconds: float = 0.5
silence_seconds: float = 0.7
"""Seconds of silence after voice command has ended."""
def __post_init__(self) -> None:
@@ -538,7 +538,7 @@ class PipelineRun:
language: str = None # type: ignore[assignment]
runner_data: Any | None = None
intent_agent: str | None = None
tts_audio_output: str | None = None
tts_audio_output: str | dict[str, Any] | None = None
wake_word_settings: WakeWordSettings | None = None
audio_settings: AudioSettings = field(default_factory=AudioSettings)
@@ -906,6 +906,8 @@ class PipelineRun:
metadata,
self._speech_to_text_stream(audio_stream=stream, stt_vad=stt_vad),
)
except (asyncio.CancelledError, TimeoutError):
raise # expected
except Exception as src_error:
_LOGGER.exception("Unexpected error during speech-to-text")
raise SpeechToTextError(
@@ -1052,12 +1054,15 @@ class PipelineRun:
if self.pipeline.tts_voice is not None:
tts_options[tts.ATTR_VOICE] = self.pipeline.tts_voice
if self.tts_audio_output is not None:
if isinstance(self.tts_audio_output, dict):
tts_options.update(self.tts_audio_output)
elif isinstance(self.tts_audio_output, str):
tts_options[tts.ATTR_PREFERRED_FORMAT] = self.tts_audio_output
if self.tts_audio_output == "wav":
# 16 Khz, 16-bit mono
tts_options[tts.ATTR_PREFERRED_SAMPLE_RATE] = SAMPLE_RATE
tts_options[tts.ATTR_PREFERRED_SAMPLE_CHANNELS] = SAMPLE_CHANNELS
tts_options[tts.ATTR_PREFERRED_SAMPLE_BYTES] = SAMPLE_WIDTH
try:
options_supported = await tts.async_support_options(

View File

@@ -9,12 +9,10 @@ from homeassistant.const import EntityCategory, Platform
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import collection, entity_registry as er, restore_state
from .const import DOMAIN
from .const import DOMAIN, OPTION_PREFERRED
from .pipeline import AssistDevice, PipelineData, PipelineStorageCollection
from .vad import VadSensitivity
OPTION_PREFERRED = "preferred"
@callback
def get_chosen_pipeline(

View File

@@ -0,0 +1,65 @@
"""Base class for assist satellite entities."""
import logging
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.typing import ConfigType
from .const import DOMAIN, AssistSatelliteEntityFeature
from .entity import AssistSatelliteEntity, AssistSatelliteEntityDescription
from .errors import SatelliteBusyError
from .websocket_api import async_register_websocket_api
__all__ = [
"DOMAIN",
"AssistSatelliteEntity",
"AssistSatelliteEntityDescription",
"AssistSatelliteEntityFeature",
"SatelliteBusyError",
]
_LOGGER = logging.getLogger(__name__)
PLATFORM_SCHEMA_BASE = cv.PLATFORM_SCHEMA_BASE
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
component = hass.data[DOMAIN] = EntityComponent[AssistSatelliteEntity](
_LOGGER, DOMAIN, hass
)
await component.async_setup(config)
component.async_register_entity_service(
"announce",
vol.All(
cv.make_entity_service_schema(
{
vol.Optional("message"): str,
vol.Optional("media_id"): str,
}
),
cv.has_at_least_one_key("message", "media_id"),
),
"async_internal_announce",
[AssistSatelliteEntityFeature.ANNOUNCE],
)
async_register_websocket_api(hass)
return True
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up a config entry."""
component: EntityComponent[AssistSatelliteEntity] = hass.data[DOMAIN]
return await component.async_setup_entry(entry)
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
component: EntityComponent[AssistSatelliteEntity] = hass.data[DOMAIN]
return await component.async_unload_entry(entry)

View File

@@ -0,0 +1,12 @@
"""Constants for assist satellite."""
from enum import IntFlag
DOMAIN = "assist_satellite"
class AssistSatelliteEntityFeature(IntFlag):
"""Supported features of Assist satellite entity."""
ANNOUNCE = 1
"""Device supports remotely triggered announcements."""

View File

@@ -0,0 +1,341 @@
"""Assist satellite entity."""
from abc import abstractmethod
import asyncio
from collections.abc import AsyncIterable
from enum import StrEnum
import logging
import time
from typing import Any, Final, final
from homeassistant.components import media_source, stt, tts
from homeassistant.components.assist_pipeline import (
OPTION_PREFERRED,
AudioSettings,
PipelineEvent,
PipelineEventType,
PipelineStage,
async_get_pipeline,
async_get_pipelines,
async_pipeline_from_audio_stream,
vad,
)
from homeassistant.components.media_player import async_process_play_media_url
from homeassistant.components.tts.media_source import (
generate_media_source_id as tts_generate_media_source_id,
)
from homeassistant.core import Context, callback
from homeassistant.helpers import entity
from homeassistant.helpers.entity import EntityDescription
from homeassistant.util import ulid
from .const import AssistSatelliteEntityFeature
from .errors import AssistSatelliteError, SatelliteBusyError
_CONVERSATION_TIMEOUT_SEC: Final = 5 * 60 # 5 minutes
_LOGGER = logging.getLogger(__name__)
class AssistSatelliteState(StrEnum):
"""Valid states of an Assist satellite entity."""
LISTENING_WAKE_WORD = "listening_wake_word"
"""Device is streaming audio for wake word detection to Home Assistant."""
LISTENING_COMMAND = "listening_command"
"""Device is streaming audio with the voice command to Home Assistant."""
PROCESSING = "processing"
"""Home Assistant is processing the voice command."""
RESPONDING = "responding"
"""Device is speaking the response."""
class AssistSatelliteEntityDescription(EntityDescription, frozen_or_thawed=True):
"""A class that describes Assist satellite entities."""
class AssistSatelliteEntity(entity.Entity):
"""Entity encapsulating the state and functionality of an Assist satellite."""
entity_description: AssistSatelliteEntityDescription
_attr_should_poll = False
_attr_supported_features = AssistSatelliteEntityFeature(0)
_attr_pipeline_entity_id: str | None = None
_attr_vad_sensitivity_entity_id: str | None = None
_conversation_id: str | None = None
_conversation_id_time: float | None = None
_run_has_tts: bool = False
_is_announcing = False
_wake_word_intercept_future: asyncio.Future[str | None] | None = None
_attr_tts_options: dict[str, Any] | None = None
__assist_satellite_state = AssistSatelliteState.LISTENING_WAKE_WORD
@final
@property
def state(self) -> str | None:
"""Return state of the entity."""
return self.__assist_satellite_state
@property
def pipeline_entity_id(self) -> str | None:
"""Entity ID of the pipeline to use for the next conversation."""
return self._attr_pipeline_entity_id
@property
def vad_sensitivity_entity_id(self) -> str | None:
"""Entity ID of the VAD sensitivity to use for the next conversation."""
return self._attr_vad_sensitivity_entity_id
@property
def tts_options(self) -> dict[str, Any] | None:
"""Options passed for text-to-speech."""
return self._attr_tts_options
async def async_intercept_wake_word(self) -> str | None:
"""Intercept the next wake word from the satellite.
Returns the detected wake word phrase or None.
"""
if self._wake_word_intercept_future is not None:
raise SatelliteBusyError("Wake word interception already in progress")
# Will cause next wake word to be intercepted in
# async_accept_pipeline_from_satellite
self._wake_word_intercept_future = asyncio.Future()
_LOGGER.debug("Next wake word will be intercepted: %s", self.entity_id)
try:
return await self._wake_word_intercept_future
finally:
self._wake_word_intercept_future = None
async def async_internal_announce(
self,
message: str | None = None,
media_id: str | None = None,
) -> None:
"""Play and show an announcement on the satellite.
If media_id is not provided, message is synthesized to
audio with the selected pipeline.
If media_id is provided, it is played directly. It is possible
to omit the message and the satellite will not show any text.
Calls async_announce with message and media id.
"""
if message is None:
message = ""
if not media_id:
# Synthesize audio and get URL
pipeline_id = self._resolve_pipeline()
pipeline = async_get_pipeline(self.hass, pipeline_id)
tts_options: dict[str, Any] = {}
if pipeline.tts_voice is not None:
tts_options[tts.ATTR_VOICE] = pipeline.tts_voice
if self.tts_options is not None:
tts_options.update(self.tts_options)
media_id = tts_generate_media_source_id(
self.hass,
message,
engine=pipeline.tts_engine,
language=pipeline.tts_language,
options=tts_options,
)
if media_source.is_media_source_id(media_id):
media = await media_source.async_resolve_media(
self.hass,
media_id,
None,
)
media_id = media.url
# Resolve to full URL
media_id = async_process_play_media_url(self.hass, media_id)
if self._is_announcing:
raise SatelliteBusyError
self._is_announcing = True
try:
# Block until announcement is finished
await self.async_announce(message, media_id)
finally:
self._is_announcing = False
async def async_announce(self, message: str, media_id: str) -> None:
"""Announce media on the satellite.
Should block until the announcement is done playing.
"""
raise NotImplementedError
async def async_accept_pipeline_from_satellite(
self,
audio_stream: AsyncIterable[bytes],
start_stage: PipelineStage = PipelineStage.STT,
end_stage: PipelineStage = PipelineStage.TTS,
wake_word_phrase: str | None = None,
) -> None:
"""Triggers an Assist pipeline in Home Assistant from a satellite."""
if self._wake_word_intercept_future and start_stage in (
PipelineStage.WAKE_WORD,
PipelineStage.STT,
):
if start_stage == PipelineStage.WAKE_WORD:
self._wake_word_intercept_future.set_exception(
AssistSatelliteError(
"Only on-device wake words currently supported"
)
)
return
# Intercepting wake word and immediately end pipeline
_LOGGER.debug(
"Intercepted wake word: %s (entity_id=%s)",
wake_word_phrase,
self.entity_id,
)
if wake_word_phrase is None:
self._wake_word_intercept_future.set_exception(
AssistSatelliteError("No wake word phrase provided")
)
else:
self._wake_word_intercept_future.set_result(wake_word_phrase)
self._internal_on_pipeline_event(PipelineEvent(PipelineEventType.RUN_END))
return
device_id = self.registry_entry.device_id if self.registry_entry else None
# Refresh context if necessary
if (
(self._context is None)
or (self._context_set is None)
or ((time.time() - self._context_set) > entity.CONTEXT_RECENT_TIME_SECONDS)
):
self.async_set_context(Context())
assert self._context is not None
# Reset conversation id if necessary
if (self._conversation_id_time is None) or (
(time.monotonic() - self._conversation_id_time) > _CONVERSATION_TIMEOUT_SEC
):
self._conversation_id = None
if self._conversation_id is None:
self._conversation_id = ulid.ulid()
# Update timeout
self._conversation_id_time = time.monotonic()
# Set entity state based on pipeline events
self._run_has_tts = False
await async_pipeline_from_audio_stream(
self.hass,
context=self._context,
event_callback=self._internal_on_pipeline_event,
stt_metadata=stt.SpeechMetadata(
language="", # set in async_pipeline_from_audio_stream
format=stt.AudioFormats.WAV,
codec=stt.AudioCodecs.PCM,
bit_rate=stt.AudioBitRates.BITRATE_16,
sample_rate=stt.AudioSampleRates.SAMPLERATE_16000,
channel=stt.AudioChannels.CHANNEL_MONO,
),
stt_stream=audio_stream,
pipeline_id=self._resolve_pipeline(),
conversation_id=self._conversation_id,
device_id=device_id,
tts_audio_output=self.tts_options,
wake_word_phrase=wake_word_phrase,
audio_settings=AudioSettings(
silence_seconds=self._resolve_vad_sensitivity()
),
start_stage=start_stage,
end_stage=end_stage,
)
@abstractmethod
def on_pipeline_event(self, event: PipelineEvent) -> None:
"""Handle pipeline events."""
@callback
def _internal_on_pipeline_event(self, event: PipelineEvent) -> None:
"""Set state based on pipeline stage."""
if event.type is PipelineEventType.WAKE_WORD_START:
self._set_state(AssistSatelliteState.LISTENING_WAKE_WORD)
elif event.type is PipelineEventType.STT_START:
self._set_state(AssistSatelliteState.LISTENING_COMMAND)
elif event.type is PipelineEventType.INTENT_START:
self._set_state(AssistSatelliteState.PROCESSING)
elif event.type is PipelineEventType.TTS_START:
# Wait until tts_response_finished is called to return to waiting state
self._run_has_tts = True
self._set_state(AssistSatelliteState.RESPONDING)
elif event.type is PipelineEventType.RUN_END:
if not self._run_has_tts:
self._set_state(AssistSatelliteState.LISTENING_WAKE_WORD)
self.on_pipeline_event(event)
@callback
def _set_state(self, state: AssistSatelliteState) -> None:
"""Set the entity's state."""
self.__assist_satellite_state = state
self.async_write_ha_state()
@callback
def tts_response_finished(self) -> None:
"""Tell entity that the text-to-speech response has finished playing."""
self._set_state(AssistSatelliteState.LISTENING_WAKE_WORD)
@callback
def _resolve_pipeline(self) -> str | None:
"""Resolve pipeline from select entity to id.
Return None to make async_get_pipeline look up the preferred pipeline.
"""
if not (pipeline_entity_id := self.pipeline_entity_id):
return None
if (pipeline_entity_state := self.hass.states.get(pipeline_entity_id)) is None:
raise RuntimeError("Pipeline entity not found")
if pipeline_entity_state.state != OPTION_PREFERRED:
# Resolve pipeline by name
for pipeline in async_get_pipelines(self.hass):
if pipeline.name == pipeline_entity_state.state:
return pipeline.id
return None
@callback
def _resolve_vad_sensitivity(self) -> float:
"""Resolve VAD sensitivity from select entity to enum."""
vad_sensitivity = vad.VadSensitivity.DEFAULT
if vad_sensitivity_entity_id := self.vad_sensitivity_entity_id:
if (
vad_sensitivity_state := self.hass.states.get(vad_sensitivity_entity_id)
) is None:
raise RuntimeError("VAD sensitivity entity not found")
vad_sensitivity = vad.VadSensitivity(vad_sensitivity_state.state)
return vad.VadSensitivity.to_seconds(vad_sensitivity)

View File

@@ -0,0 +1,11 @@
"""Errors for assist satellite."""
from homeassistant.exceptions import HomeAssistantError
class AssistSatelliteError(HomeAssistantError):
"""Base class for assist satellite errors."""
class SatelliteBusyError(AssistSatelliteError):
"""Satellite is busy and cannot handle the request."""

View File

@@ -0,0 +1,12 @@
{
"entity_component": {
"_": {
"default": "mdi:account-voice"
}
},
"services": {
"announce": {
"service": "mdi:bullhorn"
}
}
}

View File

@@ -0,0 +1,9 @@
{
"domain": "assist_satellite",
"name": "Assist Satellite",
"codeowners": ["@home-assistant/core", "@synesthesiam"],
"dependencies": ["assist_pipeline", "stt", "tts"],
"documentation": "https://www.home-assistant.io/integrations/assist_satellite",
"integration_type": "entity",
"quality_scale": "internal"
}

View File

@@ -0,0 +1,16 @@
announce:
target:
entity:
domain: assist_satellite
supported_features:
- assist_satellite.AssistSatelliteEntityFeature.ANNOUNCE
fields:
message:
required: false
example: "Time to wake up!"
selector:
text:
media_id:
required: false
selector:
text:

View File

@@ -0,0 +1,30 @@
{
"title": "Assist satellite",
"entity_component": {
"_": {
"name": "Assist satellite",
"state": {
"listening_wake_word": "Wake word",
"listening_command": "Voice command",
"responding": "Responding",
"processing": "Processing"
}
}
},
"services": {
"announce": {
"name": "Announce",
"description": "Let the satellite announce a message.",
"fields": {
"message": {
"name": "Message",
"description": "The message to announce."
},
"media_id": {
"name": "Media ID",
"description": "The media ID to announce instead of using text-to-speech."
}
}
}
}
}

View File

@@ -0,0 +1,46 @@
"""Assist satellite Websocket API."""
from typing import Any
import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity_component import EntityComponent
from .const import DOMAIN
from .entity import AssistSatelliteEntity
@callback
def async_register_websocket_api(hass: HomeAssistant) -> None:
"""Register the websocket API."""
websocket_api.async_register_command(hass, websocket_intercept_wake_word)
@callback
@websocket_api.websocket_command(
{
vol.Required("type"): "assist_satellite/intercept_wake_word",
vol.Required("entity_id"): cv.entity_domain(DOMAIN),
}
)
@websocket_api.require_admin
@websocket_api.async_response
async def websocket_intercept_wake_word(
hass: HomeAssistant,
connection: websocket_api.connection.ActiveConnection,
msg: dict[str, Any],
) -> None:
"""Intercept the next wake word from a satellite."""
component: EntityComponent[AssistSatelliteEntity] = hass.data[DOMAIN]
satellite = component.get_entity(msg["entity_id"])
if satellite is None:
connection.send_error(
msg["id"], websocket_api.ERR_NOT_FOUND, "Entity not found"
)
return
wake_word_phrase = await satellite.async_intercept_wake_word()
connection.send_result(msg["id"], {"wake_word_phrase": wake_word_phrase})

View File

@@ -5,6 +5,7 @@ from __future__ import annotations
from abc import ABC, abstractmethod
from collections import namedtuple
from collections.abc import Awaitable, Callable, Coroutine
from datetime import datetime
import functools
import logging
from typing import Any, cast
@@ -40,17 +41,23 @@ from .const import (
PROTOCOL_HTTPS,
PROTOCOL_TELNET,
SENSORS_BYTES,
SENSORS_CPU,
SENSORS_LOAD_AVG,
SENSORS_MEMORY,
SENSORS_RATES,
SENSORS_TEMPERATURES,
SENSORS_TEMPERATURES_LEGACY,
SENSORS_UPTIME,
)
SENSORS_TYPE_BYTES = "sensors_bytes"
SENSORS_TYPE_COUNT = "sensors_count"
SENSORS_TYPE_CPU = "sensors_cpu"
SENSORS_TYPE_LOAD_AVG = "sensors_load_avg"
SENSORS_TYPE_MEMORY = "sensors_memory"
SENSORS_TYPE_RATES = "sensors_rates"
SENSORS_TYPE_TEMPERATURES = "sensors_temperatures"
SENSORS_TYPE_UPTIME = "sensors_uptime"
WrtDevice = namedtuple("WrtDevice", ["ip", "name", "connected_to"]) # noqa: PYI024
@@ -346,6 +353,7 @@ class AsusWrtHttpBridge(AsusWrtBridge):
async def async_get_available_sensors(self) -> dict[str, dict[str, Any]]:
"""Return a dictionary of available sensors for this bridge."""
sensors_cpu = await self._get_available_cpu_sensors()
sensors_temperatures = await self._get_available_temperature_sensors()
sensors_loadavg = await self._get_loadavg_sensors_availability()
return {
@@ -353,20 +361,49 @@ class AsusWrtHttpBridge(AsusWrtBridge):
KEY_SENSORS: SENSORS_BYTES,
KEY_METHOD: self._get_bytes,
},
SENSORS_TYPE_CPU: {
KEY_SENSORS: sensors_cpu,
KEY_METHOD: self._get_cpu_usage,
},
SENSORS_TYPE_LOAD_AVG: {
KEY_SENSORS: sensors_loadavg,
KEY_METHOD: self._get_load_avg,
},
SENSORS_TYPE_MEMORY: {
KEY_SENSORS: SENSORS_MEMORY,
KEY_METHOD: self._get_memory_usage,
},
SENSORS_TYPE_RATES: {
KEY_SENSORS: SENSORS_RATES,
KEY_METHOD: self._get_rates,
},
SENSORS_TYPE_UPTIME: {
KEY_SENSORS: SENSORS_UPTIME,
KEY_METHOD: self._get_uptime,
},
SENSORS_TYPE_TEMPERATURES: {
KEY_SENSORS: sensors_temperatures,
KEY_METHOD: self._get_temperatures,
},
}
async def _get_available_cpu_sensors(self) -> list[str]:
"""Check which cpu information is available on the router."""
try:
available_cpu = await self._api.async_get_cpu_usage()
available_sensors = [t for t in SENSORS_CPU if t in available_cpu]
except AsusWrtError as exc:
_LOGGER.warning(
(
"Failed checking cpu sensor availability for ASUS router"
" %s. Exception: %s"
),
self.host,
exc,
)
return []
return available_sensors
async def _get_available_temperature_sensors(self) -> list[str]:
"""Check which temperature information is available on the router."""
try:
@@ -415,3 +452,25 @@ class AsusWrtHttpBridge(AsusWrtBridge):
async def _get_temperatures(self) -> Any:
"""Fetch temperatures information from the router."""
return await self._api.async_get_temperatures()
@handle_errors_and_zip(AsusWrtError, None)
async def _get_cpu_usage(self) -> Any:
"""Fetch cpu information from the router."""
return await self._api.async_get_cpu_usage()
@handle_errors_and_zip(AsusWrtError, None)
async def _get_memory_usage(self) -> Any:
"""Fetch memory information from the router."""
return await self._api.async_get_memory_usage()
async def _get_uptime(self) -> dict[str, Any]:
"""Fetch uptime from the router."""
try:
uptimes = await self._api.async_get_uptime()
except AsusWrtError as exc:
raise UpdateFailed(exc) from exc
last_boot = datetime.fromisoformat(uptimes["last_boot"])
uptime = uptimes["uptime"]
return dict(zip(SENSORS_UPTIME, [last_boot, uptime], strict=False))

View File

@@ -27,7 +27,20 @@ PROTOCOL_TELNET = "telnet"
# Sensors
SENSORS_BYTES = ["sensor_rx_bytes", "sensor_tx_bytes"]
SENSORS_CONNECTED_DEVICE = ["sensor_connected_device"]
SENSORS_CPU = [
"cpu_total_usage",
"cpu1_usage",
"cpu2_usage",
"cpu3_usage",
"cpu4_usage",
"cpu5_usage",
"cpu6_usage",
"cpu7_usage",
"cpu8_usage",
]
SENSORS_LOAD_AVG = ["sensor_load_avg1", "sensor_load_avg5", "sensor_load_avg15"]
SENSORS_MEMORY = ["mem_usage_perc", "mem_free", "mem_used"]
SENSORS_RATES = ["sensor_rx_rates", "sensor_tx_rates"]
SENSORS_TEMPERATURES_LEGACY = ["2.4GHz", "5.0GHz", "CPU"]
SENSORS_TEMPERATURES = [*SENSORS_TEMPERATURES_LEGACY, "5.0GHz_2", "6.0GHz"]
SENSORS_UPTIME = ["sensor_last_boot", "sensor_uptime"]

View File

@@ -24,6 +24,21 @@
},
"load_avg_15m": {
"default": "mdi:cpu-32-bit"
},
"cpu_usage": {
"default": "mdi:cpu-32-bit"
},
"cpu_core_usage": {
"default": "mdi:cpu-32-bit"
},
"memory_usage": {
"default": "mdi:memory"
},
"memory_free": {
"default": "mdi:memory"
},
"memory_used": {
"default": "mdi:memory"
}
}
}

View File

@@ -11,10 +11,12 @@ from homeassistant.components.sensor import (
SensorStateClass,
)
from homeassistant.const import (
PERCENTAGE,
EntityCategory,
UnitOfDataRate,
UnitOfInformation,
UnitOfTemperature,
UnitOfTime,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@@ -30,9 +32,12 @@ from .const import (
KEY_SENSORS,
SENSORS_BYTES,
SENSORS_CONNECTED_DEVICE,
SENSORS_CPU,
SENSORS_LOAD_AVG,
SENSORS_MEMORY,
SENSORS_RATES,
SENSORS_TEMPERATURES,
SENSORS_UPTIME,
)
from .router import AsusWrtRouter
@@ -46,6 +51,19 @@ class AsusWrtSensorEntityDescription(SensorEntityDescription):
UNIT_DEVICES = "Devices"
CPU_CORE_SENSORS: tuple[AsusWrtSensorEntityDescription, ...] = tuple(
AsusWrtSensorEntityDescription(
key=sens_key,
translation_key="cpu_core_usage",
translation_placeholders={"core_id": str(core_id)},
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
suggested_display_precision=1,
)
for core_id, sens_key in enumerate(SENSORS_CPU[1:], start=1)
)
CONNECTION_SENSORS: tuple[AsusWrtSensorEntityDescription, ...] = (
AsusWrtSensorEntityDescription(
key=SENSORS_CONNECTED_DEVICE[0],
@@ -167,6 +185,61 @@ CONNECTION_SENSORS: tuple[AsusWrtSensorEntityDescription, ...] = (
entity_registry_enabled_default=False,
suggested_display_precision=1,
),
AsusWrtSensorEntityDescription(
key=SENSORS_MEMORY[0],
translation_key="memory_usage",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
suggested_display_precision=1,
),
AsusWrtSensorEntityDescription(
key=SENSORS_MEMORY[1],
translation_key="memory_free",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.DATA_SIZE,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
suggested_display_precision=2,
factor=1024,
),
AsusWrtSensorEntityDescription(
key=SENSORS_MEMORY[2],
translation_key="memory_used",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.DATA_SIZE,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
suggested_display_precision=2,
factor=1024,
),
AsusWrtSensorEntityDescription(
key=SENSORS_UPTIME[0],
translation_key="last_boot",
device_class=SensorDeviceClass.TIMESTAMP,
),
AsusWrtSensorEntityDescription(
key=SENSORS_UPTIME[1],
translation_key="uptime",
state_class=SensorStateClass.TOTAL,
device_class=SensorDeviceClass.DURATION,
native_unit_of_measurement=UnitOfTime.SECONDS,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
),
AsusWrtSensorEntityDescription(
key=SENSORS_CPU[0],
translation_key="cpu_usage",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
suggested_display_precision=1,
),
*CPU_CORE_SENSORS,
)

View File

@@ -88,6 +88,27 @@
},
"6ghz_temperature": {
"name": "6GHz Temperature"
},
"cpu_usage": {
"name": "CPU usage"
},
"cpu_core_usage": {
"name": "CPU core {core_id} usage"
},
"memory_usage": {
"name": "Memory usage"
},
"memory_free": {
"name": "Memory free"
},
"memory_used": {
"name": "Memory used"
},
"last_boot": {
"name": "Last boot"
},
"uptime": {
"name": "Uptime"
}
}
},

View File

@@ -6,15 +6,16 @@ from pathlib import Path
from typing import cast
from aiohttp import ClientResponseError
from yalexs.const import Brand
from yalexs.exceptions import AugustApiAIOHTTPError
from yalexs.manager.exceptions import CannotConnect, InvalidAuth, RequireValidation
from yalexs.manager.gateway import Config as YaleXSConfig
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers import device_registry as dr, issue_registry as ir
from .const import DOMAIN, PLATFORMS
from .data import AugustData
@@ -24,7 +25,27 @@ from .util import async_create_august_clientsession
type AugustConfigEntry = ConfigEntry[AugustData]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
@callback
def _async_create_yale_brand_migration_issue(
hass: HomeAssistant, entry: AugustConfigEntry
) -> None:
"""Create an issue for a brand migration."""
ir.async_create_issue(
hass,
DOMAIN,
"yale_brand_migration",
breaks_in_ha_version="2024.9",
learn_more_url="https://www.home-assistant.io/integrations/yale",
translation_key="yale_brand_migration",
is_fixable=False,
severity=ir.IssueSeverity.CRITICAL,
translation_placeholders={
"migrate_url": "https://my.home-assistant.io/redirect/config_flow_start?domain=yale"
},
)
async def async_setup_entry(hass: HomeAssistant, entry: AugustConfigEntry) -> bool:
"""Set up August from a config entry."""
session = async_create_august_clientsession(hass)
august_gateway = AugustGateway(Path(hass.config.config_dir), session)
@@ -40,6 +61,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_remove_entry(hass: HomeAssistant, entry: AugustConfigEntry) -> None:
"""Remove an August config entry."""
ir.async_delete_issue(hass, DOMAIN, "yale_brand_migration")
async def async_unload_entry(hass: HomeAssistant, entry: AugustConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
@@ -51,6 +77,8 @@ async def async_setup_august(
"""Set up the August component."""
config = cast(YaleXSConfig, entry.data)
await august_gateway.async_setup(config)
if august_gateway.api.brand == Brand.YALE_HOME:
_async_create_yale_brand_migration_issue(hass, entry)
await august_gateway.async_authenticate()
await august_gateway.async_refresh_access_token_if_needed()
data = entry.runtime_data = AugustData(hass, august_gateway)

View File

@@ -109,12 +109,11 @@ async def async_setup_entry(
for description in SENSOR_TYPES_DOORBELL
)
for doorbell in data.doorbells:
entities.extend(
AugustDoorbellBinarySensor(data, doorbell, description)
for description in SENSOR_TYPES_DOORBELL + SENSOR_TYPES_VIDEO_DOORBELL
)
entities.extend(
AugustDoorbellBinarySensor(data, doorbell, description)
for description in SENSOR_TYPES_DOORBELL + SENSOR_TYPES_VIDEO_DOORBELL
for doorbell in data.doorbells
)
async_add_entities(entities)

View File

@@ -5,7 +5,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AugustConfigEntry
from .entity import AugustEntityMixin
from .entity import AugustEntity
async def async_setup_entry(
@@ -18,7 +18,7 @@ async def async_setup_entry(
async_add_entities(AugustWakeLockButton(data, lock, "wake") for lock in data.locks)
class AugustWakeLockButton(AugustEntityMixin, ButtonEntity):
class AugustWakeLockButton(AugustEntity, ButtonEntity):
"""Representation of an August lock wake button."""
_attr_translation_key = "wake"

View File

@@ -16,7 +16,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AugustConfigEntry, AugustData
from .const import DEFAULT_NAME, DEFAULT_TIMEOUT
from .entity import AugustEntityMixin
from .entity import AugustEntity
_LOGGER = logging.getLogger(__name__)
@@ -38,7 +38,7 @@ async def async_setup_entry(
)
class AugustCamera(AugustEntityMixin, Camera):
class AugustCamera(AugustEntity, Camera):
"""An implementation of an August security camera."""
_attr_translation_key = "camera"

View File

@@ -9,7 +9,7 @@ from typing import Any
import aiohttp
import voluptuous as vol
from yalexs.authenticator_common import ValidationResult
from yalexs.const import BRANDS_WITHOUT_OAUTH, DEFAULT_BRAND
from yalexs.const import BRANDS_WITHOUT_OAUTH, DEFAULT_BRAND, Brand
from yalexs.manager.exceptions import CannotConnect, InvalidAuth, RequireValidation
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
@@ -28,6 +28,12 @@ from .const import (
from .gateway import AugustGateway
from .util import async_create_august_clientsession
# The Yale Home Brand is not supported by the August integration
# anymore and should migrate to the Yale integration
AVAILABLE_BRANDS = BRANDS_WITHOUT_OAUTH.copy()
del AVAILABLE_BRANDS[Brand.YALE_HOME]
_LOGGER = logging.getLogger(__name__)
@@ -118,7 +124,7 @@ class AugustConfigFlow(ConfigFlow, domain=DOMAIN):
vol.Required(
CONF_BRAND,
default=self._user_auth_details.get(CONF_BRAND, DEFAULT_BRAND),
): vol.In(BRANDS_WITHOUT_OAUTH),
): vol.In(AVAILABLE_BRANDS),
vol.Required(
CONF_LOGIN_METHOD,
default=self._user_auth_details.get(

View File

@@ -20,7 +20,7 @@ from .const import MANUFACTURER
DEVICE_TYPES = ["keypad", "lock", "camera", "doorbell", "door", "bell"]
class AugustEntityMixin(Entity):
class AugustEntity(Entity):
"""Base implementation for August device."""
_attr_should_poll = False
@@ -87,7 +87,7 @@ class AugustEntityMixin(Entity):
self._update_from_data()
class AugustDescriptionEntity(AugustEntityMixin):
class AugustDescriptionEntity(AugustEntity):
"""An August entity with a description."""
def __init__(

View File

@@ -63,22 +63,17 @@ async def async_setup_entry(
) -> None:
"""Set up the august event platform."""
data = config_entry.runtime_data
entities: list[AugustEventEntity] = []
for lock in data.locks:
detail = data.get_device_detail(lock.device_id)
if detail.doorbell:
entities.extend(
AugustEventEntity(data, lock, description)
for description in TYPES_DOORBELL
)
for doorbell in data.doorbells:
entities.extend(
AugustEventEntity(data, doorbell, description)
for description in TYPES_DOORBELL + TYPES_VIDEO_DOORBELL
)
entities: list[AugustEventEntity] = [
AugustEventEntity(data, lock, description)
for description in TYPES_DOORBELL
for lock in data.locks
if (detail := data.get_device_detail(lock.device_id)) and detail.doorbell
]
entities.extend(
AugustEventEntity(data, doorbell, description)
for description in TYPES_DOORBELL + TYPES_VIDEO_DOORBELL
for doorbell in data.doorbells
)
async_add_entities(entities)
@@ -86,7 +81,6 @@ class AugustEventEntity(AugustDescriptionEntity, EventEntity):
"""An august event entity."""
entity_description: AugustEventEntityDescription
_attr_has_entity_name = True
_last_activity: Activity | None = None
@callback

View File

@@ -19,7 +19,7 @@ from homeassistant.helpers.restore_state import RestoreEntity
import homeassistant.util.dt as dt_util
from . import AugustConfigEntry, AugustData
from .entity import AugustEntityMixin
from .entity import AugustEntity
_LOGGER = logging.getLogger(__name__)
@@ -36,7 +36,7 @@ async def async_setup_entry(
async_add_entities(AugustLock(data, lock) for lock in data.locks)
class AugustLock(AugustEntityMixin, RestoreEntity, LockEntity):
class AugustLock(AugustEntity, RestoreEntity, LockEntity):
"""Representation of an August lock."""
_attr_name = None

View File

@@ -24,5 +24,5 @@
"documentation": "https://www.home-assistant.io/integrations/august",
"iot_class": "cloud_push",
"loggers": ["pubnub", "yalexs"],
"requirements": ["yalexs==8.5.4", "yalexs-ble==2.4.3"]
"requirements": ["yalexs==8.6.4", "yalexs-ble==2.4.3"]
}

View File

@@ -4,7 +4,7 @@ from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any, Generic, TypeVar, cast
from typing import Any, cast
from yalexs.activity import ActivityType, LockOperationActivity
from yalexs.doorbell import Doorbell
@@ -42,7 +42,7 @@ from .const import (
OPERATION_METHOD_REMOTE,
OPERATION_METHOD_TAG,
)
from .entity import AugustDescriptionEntity, AugustEntityMixin
from .entity import AugustDescriptionEntity, AugustEntity
def _retrieve_device_battery_state(detail: LockDetail) -> int:
@@ -55,14 +55,13 @@ def _retrieve_linked_keypad_battery_state(detail: KeypadDetail) -> int | None:
return detail.battery_percentage
_T = TypeVar("_T", LockDetail, KeypadDetail)
@dataclass(frozen=True, kw_only=True)
class AugustSensorEntityDescription(SensorEntityDescription, Generic[_T]):
class AugustSensorEntityDescription[T: LockDetail | KeypadDetail](
SensorEntityDescription
):
"""Mixin for required keys."""
value_fn: Callable[[_T], int | None]
value_fn: Callable[[T], int | None]
SENSOR_TYPE_DEVICE_BATTERY = AugustSensorEntityDescription[LockDetail](
@@ -114,7 +113,7 @@ async def async_setup_entry(
async_add_entities(entities)
class AugustOperatorSensor(AugustEntityMixin, RestoreSensor):
class AugustOperatorSensor(AugustEntity, RestoreSensor):
"""Representation of an August lock operation sensor."""
_attr_translation_key = "operator"
@@ -198,10 +197,12 @@ class AugustOperatorSensor(AugustEntityMixin, RestoreSensor):
self._operated_autorelock = last_attrs[ATTR_OPERATION_AUTORELOCK]
class AugustBatterySensor(AugustDescriptionEntity, SensorEntity, Generic[_T]):
class AugustBatterySensor[T: LockDetail | KeypadDetail](
AugustDescriptionEntity, SensorEntity
):
"""Representation of an August sensor."""
entity_description: AugustSensorEntityDescription[_T]
entity_description: AugustSensorEntityDescription[T]
_attr_device_class = SensorDeviceClass.BATTERY
_attr_native_unit_of_measurement = PERCENTAGE

View File

@@ -1,4 +1,10 @@
{
"issues": {
"yale_brand_migration": {
"title": "Yale Home has a new integration",
"description": "Add the [Yale integration]({migrate_url}), and remove the August integration as soon as possible to avoid an interruption in service. The Yale Home brand will stop working with the August integration soon and will be removed in a future release."
}
},
"config": {
"error": {
"unhandled": "Unhandled error: {error}",

View File

@@ -63,16 +63,11 @@ def _activity_time_based(latest: Activity) -> Activity | None:
"""Get the latest state of the sensor."""
start = latest.activity_start_time
end = latest.activity_end_time + TIME_TO_DECLARE_DETECTION
if start <= _native_datetime() <= end:
if start <= datetime.now() <= end:
return latest
return None
def _native_datetime() -> datetime:
"""Return time in the format august uses without timezone."""
return datetime.now()
def retrieve_online_state(
data: AugustData, detail: DoorbellDetail | LockDetail
) -> bool:

View File

@@ -991,15 +991,15 @@ async def _create_automation_entities(
# Add trigger variables to variables
variables = None
if CONF_TRIGGER_VARIABLES in config_block:
if CONF_TRIGGER_VARIABLES in config_block and CONF_VARIABLES in config_block:
variables = ScriptVariables(
dict(config_block[CONF_TRIGGER_VARIABLES].as_dict())
)
if CONF_VARIABLES in config_block:
if variables:
variables.variables.update(config_block[CONF_VARIABLES].as_dict())
else:
variables = config_block[CONF_VARIABLES]
variables.variables.update(config_block[CONF_VARIABLES].as_dict())
elif CONF_TRIGGER_VARIABLES in config_block:
variables = config_block[CONF_TRIGGER_VARIABLES]
elif CONF_VARIABLES in config_block:
variables = config_block[CONF_VARIABLES]
entity = AutomationEntity(
automation_id,

View File

@@ -293,6 +293,7 @@ class AwairSensor(CoordinatorEntity[AwairDataUpdateCoordinator], SensorEntity):
identifiers={(DOMAIN, self._device.uuid)},
manufacturer="Awair",
model=self._device.model,
model_id=self._device.device_type,
name=(
self._device.name
or cast(ConfigEntry, self.coordinator.config_entry).title

View File

@@ -6,8 +6,14 @@ import logging
from typing import Final
from aioazuredevops.client import DevOpsClient
from aioazuredevops.helper import (
WorkItemTypeAndState,
work_item_types_states_filter,
work_items_by_type_and_state,
)
from aioazuredevops.models.build import Build
from aioazuredevops.models.core import Project
from aioazuredevops.models.work_item_type import Category
import aiohttp
from homeassistant.config_entries import ConfigEntry
@@ -20,6 +26,7 @@ from .const import CONF_ORG, DOMAIN
from .data import AzureDevOpsData
BUILDS_QUERY: Final = "?queryOrder=queueTimeDescending&maxBuildsPerDefinition=1"
IGNORED_CATEGORIES: Final[list[Category]] = [Category.COMPLETED, Category.REMOVED]
def ado_exception_none_handler(func: Callable) -> Callable:
@@ -105,13 +112,60 @@ class AzureDevOpsDataUpdateCoordinator(DataUpdateCoordinator[AzureDevOpsData]):
BUILDS_QUERY,
)
@ado_exception_none_handler
async def _get_work_items(
self, project_name: str
) -> list[WorkItemTypeAndState] | None:
"""Get the work items."""
if (
work_item_types := await self.client.get_work_item_types(
self.organization,
project_name,
)
) is None:
# If no work item types are returned, return an empty list
return []
if (
work_item_ids := await self.client.get_work_item_ids(
self.organization,
project_name,
# Filter out completed and removed work items so we only get active work items
states=work_item_types_states_filter(
work_item_types,
ignored_categories=IGNORED_CATEGORIES,
),
)
) is None:
# If no work item ids are returned, return an empty list
return []
if (
work_items := await self.client.get_work_items(
self.organization,
project_name,
work_item_ids,
)
) is None:
# If no work items are returned, return an empty list
return []
return work_items_by_type_and_state(
work_item_types,
work_items,
ignored_categories=IGNORED_CATEGORIES,
)
async def _async_update_data(self) -> AzureDevOpsData:
"""Fetch data from Azure DevOps."""
# Get the builds from the project
builds = await self._get_builds(self.project.name)
work_items = await self._get_work_items(self.project.name)
return AzureDevOpsData(
organization=self.organization,
project=self.project,
builds=builds,
work_items=work_items,
)

View File

@@ -2,6 +2,7 @@
from dataclasses import dataclass
from aioazuredevops.helper import WorkItemTypeAndState
from aioazuredevops.models.build import Build
from aioazuredevops.models.core import Project
@@ -13,3 +14,4 @@ class AzureDevOpsData:
organization: str
project: Project
builds: list[Build]
work_items: list[WorkItemTypeAndState]

View File

@@ -3,6 +3,9 @@
"sensor": {
"latest_build": {
"default": "mdi:pipe"
},
"work_item_count": {
"default": "mdi:ticket"
}
}
}

View File

@@ -8,6 +8,7 @@ from datetime import datetime
import logging
from typing import Any
from aioazuredevops.helper import WorkItemState, WorkItemTypeAndState
from aioazuredevops.models.build import Build
from homeassistant.components.sensor import (
@@ -29,12 +30,19 @@ _LOGGER = logging.getLogger(__name__)
@dataclass(frozen=True, kw_only=True)
class AzureDevOpsBuildSensorEntityDescription(SensorEntityDescription):
"""Class describing Azure DevOps base build sensor entities."""
"""Class describing Azure DevOps build sensor entities."""
attr_fn: Callable[[Build], dict[str, Any] | None] = lambda _: None
value_fn: Callable[[Build], datetime | StateType]
@dataclass(frozen=True, kw_only=True)
class AzureDevOpsWorkItemSensorEntityDescription(SensorEntityDescription):
"""Class describing Azure DevOps work item sensor entities."""
value_fn: Callable[[WorkItemState], datetime | StateType]
BASE_BUILD_SENSOR_DESCRIPTIONS: tuple[AzureDevOpsBuildSensorEntityDescription, ...] = (
# Attributes are deprecated in 2024.7 and can be removed in 2025.1
AzureDevOpsBuildSensorEntityDescription(
@@ -116,6 +124,16 @@ BASE_BUILD_SENSOR_DESCRIPTIONS: tuple[AzureDevOpsBuildSensorEntityDescription, .
),
)
BASE_WORK_ITEM_SENSOR_DESCRIPTIONS: tuple[
AzureDevOpsWorkItemSensorEntityDescription, ...
] = (
AzureDevOpsWorkItemSensorEntityDescription(
key="work_item_count",
translation_key="work_item_count",
value_fn=lambda work_item_state: len(work_item_state.work_items),
),
)
def parse_datetime(value: str | None) -> datetime | None:
"""Parse datetime string."""
@@ -134,7 +152,7 @@ async def async_setup_entry(
coordinator = entry.runtime_data
initial_builds: list[Build] = coordinator.data.builds
async_add_entities(
entities: list[SensorEntity] = [
AzureDevOpsBuildSensor(
coordinator,
description,
@@ -143,8 +161,22 @@ async def async_setup_entry(
for description in BASE_BUILD_SENSOR_DESCRIPTIONS
for key, build in enumerate(initial_builds)
if build.project and build.definition
]
entities.extend(
AzureDevOpsWorkItemSensor(
coordinator,
description,
key,
state_key,
)
for description in BASE_WORK_ITEM_SENSOR_DESCRIPTIONS
for key, work_item_type_state in enumerate(coordinator.data.work_items)
for state_key, _ in enumerate(work_item_type_state.state_items)
)
async_add_entities(entities)
class AzureDevOpsBuildSensor(AzureDevOpsEntity, SensorEntity):
"""Define a Azure DevOps build sensor."""
@@ -162,8 +194,8 @@ class AzureDevOpsBuildSensor(AzureDevOpsEntity, SensorEntity):
self.entity_description = description
self.item_key = item_key
self._attr_unique_id = (
f"{self.coordinator.data.organization}_"
f"{self.build.project.id}_"
f"{coordinator.data.organization}_"
f"{coordinator.data.project.id}_"
f"{self.build.definition.build_id}_"
f"{description.key}"
)
@@ -185,3 +217,48 @@ class AzureDevOpsBuildSensor(AzureDevOpsEntity, SensorEntity):
def extra_state_attributes(self) -> Mapping[str, Any] | None:
"""Return the state attributes of the entity."""
return self.entity_description.attr_fn(self.build)
class AzureDevOpsWorkItemSensor(AzureDevOpsEntity, SensorEntity):
"""Define a Azure DevOps work item sensor."""
entity_description: AzureDevOpsWorkItemSensorEntityDescription
def __init__(
self,
coordinator: AzureDevOpsDataUpdateCoordinator,
description: AzureDevOpsWorkItemSensorEntityDescription,
wits_key: int,
state_key: int,
) -> None:
"""Initialize."""
super().__init__(coordinator)
self.entity_description = description
self.wits_key = wits_key
self.state_key = state_key
self._attr_unique_id = (
f"{coordinator.data.organization}_"
f"{coordinator.data.project.id}_"
f"{self.work_item_type.name}_"
f"{self.work_item_state.name}_"
f"{description.key}"
)
self._attr_translation_placeholders = {
"item_type": self.work_item_type.name,
"item_state": self.work_item_state.name,
}
@property
def work_item_type(self) -> WorkItemTypeAndState:
"""Return the work item."""
return self.coordinator.data.work_items[self.wits_key]
@property
def work_item_state(self) -> WorkItemState:
"""Return the work item state."""
return self.work_item_type.state_items[self.state_key]
@property
def native_value(self) -> datetime | StateType:
"""Return the state."""
return self.entity_description.value_fn(self.work_item_state)

View File

@@ -60,6 +60,9 @@
},
"url": {
"name": "{definition_name} latest build url"
},
"work_item_count": {
"name": "{item_type} {item_state} work items"
}
}
},

View File

@@ -60,6 +60,9 @@ COLOR_MODE_MAP = {
class BleBoxLightEntity(BleBoxEntity[blebox_uniapi.light.Light], LightEntity):
"""Representation of BleBox lights."""
_attr_max_mireds = 370 # 1,000,000 divided by 2700 Kelvin = 370 Mireds
_attr_min_mireds = 154 # 1,000,000 divided by 6500 Kelvin = 154 Mireds
def __init__(self, feature: blebox_uniapi.light.Light) -> None:
"""Initialize a BleBox light."""
super().__init__(feature)
@@ -87,12 +90,7 @@ class BleBoxLightEntity(BleBoxEntity[blebox_uniapi.light.Light], LightEntity):
Set values to _attr_ibutes if needed.
"""
color_mode_tmp = COLOR_MODE_MAP.get(self._feature.color_mode, ColorMode.ONOFF)
if color_mode_tmp == ColorMode.COLOR_TEMP:
self._attr_min_mireds = 1
self._attr_max_mireds = 255
return color_mode_tmp
return COLOR_MODE_MAP.get(self._feature.color_mode, ColorMode.ONOFF)
@property
def supported_color_modes(self):

View File

@@ -6,6 +6,6 @@
"documentation": "https://www.home-assistant.io/integrations/blebox",
"iot_class": "local_polling",
"loggers": ["blebox_uniapi"],
"requirements": ["blebox-uniapi==2.4.2"],
"requirements": ["blebox-uniapi==2.5.0"],
"zeroconf": ["_bbxsrv._tcp.local."]
}

View File

@@ -2,8 +2,8 @@
from dataclasses import dataclass
import aiohttp
from pyblu import Player, SyncStatus
from pyblu.errors import PlayerUnreachableError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PORT, Platform
@@ -22,14 +22,14 @@ PLATFORMS = [Platform.MEDIA_PLAYER]
@dataclass
class BluesoundData:
class BluesoundRuntimeData:
"""Bluesound data class."""
player: Player
sync_status: SyncStatus
type BluesoundConfigEntry = ConfigEntry[BluesoundData]
type BluesoundConfigEntry = ConfigEntry[BluesoundRuntimeData]
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
@@ -51,14 +51,10 @@ async def async_setup_entry(
async with Player(host, port, session=session, default_timeout=10) as player:
try:
sync_status = await player.sync_status(timeout=1)
except TimeoutError as ex:
raise ConfigEntryNotReady(
f"Timeout while connecting to {host}:{port}"
) from ex
except aiohttp.ClientError as ex:
except PlayerUnreachableError as ex:
raise ConfigEntryNotReady(f"Error connecting to {host}:{port}") from ex
config_entry.runtime_data = BluesoundData(player, sync_status)
config_entry.runtime_data = BluesoundRuntimeData(player, sync_status)
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

Some files were not shown because too many files have changed in this diff Show More