Commit graph

19276 commits

Author SHA1 Message Date
Michael Hansen
4bb2a3ad92
Specific Assist errors for domain/device class ()
* Specific errors for domain/device class

* Don't log exception

* Check device class first

* Refactor guard clauses

* Test default error
2024-01-08 12:23:06 -06:00
Jan Bouwhuis
20610645fb
Pop the mocked config flow, restore the original with mock_config_flow ()
Pop the mocked config flow, restore the original if it existed
2024-01-08 19:01:43 +01:00
elmurato
0d44a1eb66
Bump mcstatus to v11.1.1 ()
* Bump mcstatus to 11.1.0

* Bump mcstatus to v11.1.1
2024-01-08 16:32:37 +01:00
Joost Lekkerkerker
82e0fc5f4e
Use parametrize in drop connect binary sensor tests () 2024-01-08 10:38:44 +01:00
Josef Zweck
14bf778c10
Cleanup device registry for tedee when a lock is removed ()
* remove removed locks

* move duplicated code to function

* remove entities by removing device

* add new locks automatically

* add locks from coordinator

* smaller pr

* remove snapshot

* move lock removal to coordinator

* change comment

* Update tests/components/tedee/test_init.py

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

* Update tests/components/tedee/test_init.py

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

* test lock unavailable

* move logic to function

* resolve merge conflicts

* no need to call keys()

* no need to call keys()

* check for change first

* readability

* Update tests/components/tedee/test_lock.py

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

* Update tests/components/tedee/test_lock.py

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

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-01-08 10:37:35 +01:00
Joost Lekkerkerker
5fe96390f5
Add zone devices to AnthemAV () 2024-01-08 10:37:17 +01:00
Marc Mueller
fde7a6e9ef
Improve dispatcher typing () 2024-01-08 09:45:37 +01:00
J. Nick Koston
ea4143154b
Handle unknown state in HomeKit () 2024-01-08 09:42:28 +01:00
Jan-Philipp Benecke
40e1bab0ac
Remove deprecated YAML for freebox () 2024-01-08 09:36:17 +01:00
G Johansson
d8c139f211
Fix language flavors in holiday () 2024-01-08 09:31:44 +01:00
J. Nick Koston
d260ed938a
Reduce overhead to call entity services () 2024-01-08 09:30:52 +01:00
Jan Bouwhuis
9ad3c8dbc9
Remove MQTT legacy vacuum support () 2024-01-08 09:22:43 +01:00
J. Nick Koston
3eb81bc461
Add coverage for scanning tags with ESPHome () 2024-01-08 09:20:27 +01:00
Joost Lekkerkerker
1171a7a3d9
Migrate kmtronic to has entity name () 2024-01-08 09:14:37 +01:00
J. Nick Koston
d609344f40
Reduce duplicate code in ESPHome connection callback () 2024-01-08 09:10:58 +01:00
J. Nick Koston
efffbc08aa
Add support for bluetooth local name matchers shorter than 3 chars () 2024-01-07 18:25:56 -10:00
J. Nick Koston
acf78664e2
Reduce overhead to compile statistics ()
* Reduce overhead to compile statistics

statistics uses LazyState for compatibility with State when pulling
data from the database.

After the previous round of refactoring to modern history, the setters
are never called and can be removed.

* reduce
2024-01-07 22:36:49 -05:00
J. Nick Koston
d04e2d56da
Add support for JSON fragments () 2024-01-07 17:36:31 -10:00
J. Nick Koston
0b9992260a
Improve logbook context augment performance ()
Makes LazyEventPartialState a bit lazier since almost all the
properties are never called.
2024-01-07 22:35:28 -05:00
J. Nick Koston
d8c6534aff
Refactor recorder for common event case ()
Almost 99% of items that are put into the recorder queue are
Events. Avoid wrapping them in tasks since we have to unwrap
them right away and its must faster to check for both RecorderTask
and Events since events are the common case.
2024-01-07 22:31:40 -05:00
Matthias Alphart
f53109f513
Move KNX service registration to async_setup () 2024-01-07 23:26:46 +01:00
tronikos
810c6ea5ae
Google Generative AI: Add a service for prompts consisting of text and images using Gemini Pro Vision ()
* Bump google-generativeai to 0.3.1

* Migrate to the new API and default to gemini-pro

* Add max output tokens option

* Add generate_content service

* Add  tests

* additional checks

* async read_bytes

* Add tests for all errors
2024-01-07 16:21:27 -05:00
Matthias Alphart
a9b51f0255
Fix KNX telegram device trigger not firing after integration reload () 2024-01-07 20:32:17 +01:00
J. Nick Koston
75d591593d
Remove calls to distribution and legacy zip support from package util () 2024-01-07 07:39:48 -10:00
Raman Gupta
d19037a36b
Clean up zwave_js test_removed_device test () 2024-01-07 12:26:08 +01:00
Michael
84b20edeca
Add missing wifi data in AVM!Fritz Tools tests () 2024-01-07 10:51:31 +01:00
Brandon Rothweiler
3f2170bd06
Bump py-aosmith to 1.0.6 () 2024-01-06 12:01:11 -10:00
Brandon Rothweiler
4af47a4815
Add diagnostics to A. O. Smith integration ()
* Add diagnostics to A. O. Smith integration

* Bump py-aosmith to 1.0.4

* remove redactions from test fixture
2024-01-06 17:16:24 +01:00
Josef Zweck
7385da626e
Add new locks automatically to tedee integration ()
* remove removed locks

* move duplicated code to function

* remove entities by removing device

* add new locks automatically

* add locks from coordinator

* remove other PR stuff

* add pullspring lock to test for coverage

* requested changes
2024-01-06 16:02:07 +01:00
Jan Bouwhuis
d6aaaf1f1a
Only mock config_entries.HANDLERS for the current test in mock_config_flow () 2024-01-06 11:46:12 +01:00
Paulus Schoutsen
f1d2868fd0
Add API to fetch Assist devices ()
* Add API to fetch Assist devices

* Revert some changes to fixture, make a single fixture for an Assist device
2024-01-05 23:30:18 -05:00
J. Nick Koston
c86d1b03fc
Disable thermobeacon voltage sensors by default () 2024-01-05 16:06:31 -10:00
Marc Mueller
4e62dacc00
Fix lutron test AttributeError (2) () 2024-01-06 01:15:50 +01:00
Marc Mueller
133fd6ea5d
Fix lutron test AttributeError () 2024-01-06 00:51:17 +01:00
Shay Levy
ad3c78f848
Fix Shelly missing Gen value for older devices () 2024-01-05 13:32:04 -10:00
J. Nick Koston
81458dbf6f
Add test coverage for ESPHome state subscription () 2024-01-05 19:51:49 +01:00
Michael Hansen
a600a0e023
Expose all areas to Assist and ignore empty aliases ()
* Expose all areas to Assist

* Skip empty entity/area aliases
2024-01-05 13:45:41 -05:00
J. Nick Koston
24ee64e20c
Convert cert_expiry to use asyncio () 2024-01-05 08:03:53 -10:00
Jan-Philipp Benecke
9a15a5b6c2
Cleanup and migrate rest_command tests to be async ()
Migrate rest_command tests to be async
2024-01-05 18:53:25 +01:00
wilburCforce
be6cf7d3ae
Add Lutron config flow ()
* rough in structure for config_flow

* updated json files

* initial conversion to config_flow

* minor updates

* Update binary_sensor.py

* Update config_flow.py

* Update __init__.py

* updates beased on requested changes

* Update const.py

added doc note for ruff

* updated based on suggestions

* updated load xmldb for efficiency

* updated references

* removed unneeded file

* updated config flow to use GUID from XML DB

* minor update to change logging

* updated based on PR feedback

* reverted change for line 30 based on testing

* corrected user_input

* updated based on latest comments

* exception handling

* added raising of issues for config flow

* updated issues strings

* config flow test shell - needs work

* minor changes

* Update strings.json

* Update config_flow.py

* Update __init__.py

* Create conftest.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update config_flow.py

* Update strings.json

* Update requirements_test_all.txt

* Update strings.json

* Update strings.json

* Update config_flow.py

* Update test_config_flow.py

* Update config_flow.py

* Create test_init.py

* Update __init__.py

* Delete tests/components/lutron/test_init.py

* Update strings.json

* updated import parts and tested

* updated strings to improve user feedback

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-01-05 16:39:14 +01:00
Alexander Somov
d754ea7e22
Add new Rabbit Air integration ()
* Add new Rabbit Air integration

* Remove py.typed file

It is not needed and was just accidentally added to the commit.

* Enable strict type checking for rabbitair component

Keeping the code fully type hinted is a good idea.

* Add missing type annotations

* Remove translation file

* Prevent data to be added to hass.data if refresh fails

* Reload the config entry when the options change

* Add missing type parameters for generics

* Avoid using assert in production code

* Move zeroconf to optional dependencies

* Remove unnecessary logging

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

* Remove unused keys from the manifest

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

* Replace property with attr

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

* Allow to return None for power

The type of the is_on property now allows this.

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

* Remove unnecessary method call

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

* Update the python library

The new version properly re-exports names from the package root.

* Remove options flow

Scan interval should not be part of integration configuration. This was
the only option, so the options flow can be fully removed.

* Replace properties with attrs

* Remove multiline ternary operator

* Use NamedTuple for hass.data

* Remove unused logger variable

* Move async_setup_entry up in the file

* Adjust debouncer settings to use request_refresh

* Prevent status updates during the cooldown period

* Move device polling code to the update coordinator

* Fix the problem with the switch jumping back and forth

The UI seems to have a timeout of 2 seconds somewhere, which is just a
little bit less than what we normally need to get an updated state. So
the power switch would jump to its previous state and then immediately
return to the new state.

* Update the python library

The new version fixes errors when multiple requests are executed
simultaneously.

* Fix incorrect check for pending call in debouncer

This caused the polling to stop.

* Fix tests

* Update .coveragerc to exclude new file.
* Remove test for Options Flow.

* Update the existing entry when device access details change

* Add Zeroconf discovery step

* Fix tests

The ZeroconfServiceInfo constructor now requires one more argument.

* Fix typing for CoordinatorEntity

* Fix signature of async_turn_on

* Fix depreciation warnings

* Fix manifest formatting

* Fix warning about debouncer typing

relates to 5ae5ae5392

* Wait for config entry platform forwards

* Apply some of the suggested changes

* Do not put the MAC address in the title. Use a fixed title instead.
* Do not format the MAC to use as a unique ID.
* Do not catch exceptions in _async_update_data().
* Remove unused _entry field in the base entity class.
* Use the standard attribute self._attr_is_on to keep the power state.

* Store the MAC in the config entry data

* Change the order of except clauses

OSError is an ancestor class of TimeoutError, so TimeoutError should be
handled first

* Fix depreciation warnings

* Fix tests

The ZeroconfServiceInfo constructor arguments have changed.

* Fix DeviceInfo import

* Rename the method to make it clearer what it does

* Apply suggestions from code review

* Fix tests

* Change speed/mode logic to use is_on from the base class

* A zero value is more appropriate than None

since None means "unknown", but we actually know that the speed is zero
when the power is off.

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-01-05 16:34:28 +01:00
Jan-Philipp Benecke
8bbfee7801
Make exceptions in rest_command services translatable () 2024-01-05 15:44:31 +01:00
MisterCommand
0d7627da22
Add Hong Kong Observatory integration ()
* Add Hong Kong Observatory integration

* Move coordinator to a separate file

* Map icons to conditions

* Fix code for review

* Skip name

* Add typings to data_coordinator

* Some small fixes

* Rename coordinator.py
2024-01-05 14:52:46 +01:00
Richard Kroegel
e7573c3ed4
Add python_script response ()
* Add response to python_script

* Reset output to empty dict if not valid dict

* Add tests for python_script response

* Raise Exceptions on service execution

* Add info on exception type

* Raise ServiceValidationError instead of ValueError

* Raise only on return_response=True

* Fix exception logger if no service response

* Create issue if exception is not raised

* Revert "Create issue if exception is not raised"

This reverts commit a61dd8619f.

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2024-01-05 14:30:15 +01:00
RoboMagus
4485ece719
Add support for service response to RESTful command ()
* Add ServiceResponse to rest_command

* Handle json and text responses.
Add Unit tests

* Rest command text output handling.
Prevent issue solved by PR#97777

* Re-raise exceptions as HomeAssistantError to enable 'continue_on_error' in scripts / automations.

* Improve test coverage

* Restructure to improve McCabe Complexity

* Remove LookupError

* Revert exception catching location

* Remove LookupError from exception handling
2024-01-05 14:27:42 +01:00
Scott K Logan
f249563608
Add Rainforest RAVEn integration ()
* Add Rainforest RAVEn integration

* Add Rainforest Automation brand

* Add diagnostics to Rainforest RAVEn integration

* Drop a test assertion for an undefined behavior

* Add DEVICE_NAME test constant

* Catch up with reality

* Use Platform.SENSOR

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

* Make rainforest_raven translatable

* Stop setting device_class on unsupported scenarios

* Rename rainforest_raven.data -> rainforest_raven.coordinator

* Make _generate_unique_id more reusable

* Move device synchronization into third party library

* Switch from asyncio_timeout to asyncio.timeout

* Ignore non-electric meters

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

* Drop direct dependency on iso4217, bump aioraven

* Use RAVEn-specific exceptions

* Add timeouts to data updates

* Move DeviceInfo generation from Sensor to Coordinator

* Store meter macs as strings

* Convert to using SelectSelector

* Drop test_flow_user_invalid_mac

This test isn't necessary now that SelectSelector is used.

* Implement PR feedback

- Split some long format lines
- Simplify meter mac_id extraction in diagnostics
- Expose unique_id using an attribute instead of a property
- Add a comment about the meters dictionary shallow copy

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

* Simplify mac address redaction

Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev>

* Freeze RAVEnSensorEntityDescription dataclass

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

---------

Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev>
2024-01-05 14:00:54 +01:00
J. Nick Koston
824bb94d1d
Add test coverage for ESPHome device info () 2024-01-05 14:00:38 +01:00
Raman Gupta
85cdbb5ade
Bump zwave-js-server-python to 0.55.3 ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-01-05 12:38:00 +01:00
Erik Montnemery
c805ea7b4f
Include deprecated constants in wildcard imports () 2024-01-05 11:46:45 +01:00
Robert Resch
c063bf403a
Fix mobile_app cloudhook creation () 2024-01-05 10:53:59 +01:00