Commit Graph

71565 Commits (be4631cbf8cbb62844f48bf7123f8cb7528ce41c)

Author SHA1 Message Date
David F. Mulcahey 950660b953
Reorganize ZHA device availability code (#108856)
* Correct ZHA device availability at startup

* don't set available property from gateway

* cleanup
2024-01-27 07:17:05 -05:00
Jan Bouwhuis 677b06f502
Add comment to explain not using the core API in MQTT client (#108942) 2024-01-27 02:05:31 -10:00
matt7aylor dec9eb9ae4
Matter sensors for air quality measurements (#108173)
* Matter sensors for air quality measurements
Add sensors for CO2, PM1, PM2.5, PM10 and TVOC

* Add initial tests for matter air quality sensor

* Remove VOC data as requires unit extraction from cluster
2024-01-27 08:46:24 +01:00
Stefan Agner f35e0d8a55
Add more Thread vendor to brand mappings (#108899)
Thread: Add additional vendor to brand mappings

Add additional vendor to brand mappings for known Thread border
router vendors.
2024-01-27 08:43:08 +01:00
Yuxin Wang 16a90f8f19
Fix stalls in config flow of APCUPSD (#108931)
Fix deadlock in config flow of APCUPSD
2024-01-27 08:34:29 +01:00
J. Nick Koston 5dac5d5c7e
Refactor logbook helpers to reduce splits and lookups (#108933)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-01-26 20:07:24 -10:00
Michael Hansen 61c6c70a7d
Improved Assist debug (#108889)
* Differentiate builtin/custom sentences and triggers in debug

* Refactor so async_process runs triggers

* Report relative path of custom sentences file

* Add sentence trigger test
2024-01-26 23:04:45 -05:00
J. Nick Koston f96f4d31f7
Convert referenced registry functions to use cached_property (#108895)
* Convert referenced registry functions to use cached_property

These already implemented caching, but now that we can use cached_property
because the lock problem is solved, we can make the code simplier and faster

* missed one

* make them the same
2024-01-26 23:02:42 -05:00
J. Nick Koston 0120d00081
Switch unifiprotect to use async_update_reload_and_abort helper (#108934) 2024-01-26 22:55:58 -05:00
J. Nick Koston 5177d022e8
Switch imap to use async_update_reload_and_abort helper (#108935) 2024-01-26 22:55:26 -05:00
Robert Resch b1b53ac893
Add Ecovacs image entities (#108924)
* Add Ecovacs image entities

* Fix
2024-01-26 20:33:21 +01:00
Michael d007327cf5
Deprecate legacy Proximity entity (#108730)
* deprecate proximity entity

* add test

* extend tests

* adjust strings

* make issue fixable

* use default repairflow
2024-01-26 19:04:48 +01:00
Erik Montnemery b074334c07
Fix light color mode in advantage_air (#108875) 2024-01-26 07:22:49 -10:00
Jan Bouwhuis 7bec5ef6bc
Use unknown color_mode for MQTT json lights if color mode is not set (#108909) 2024-01-26 14:42:47 +01:00
Josef Zweck 00c2ba69f7
Add webhook support to tedee integration (#106846)
* start work on webhooks

* start work on webhooks

* use background task

* websocket improvement

* add test

* add webhook id to mock_config_entry

* some changes

* add webhook to manifest

* fix test

* reset poll timer on webhook update

* reset poll timer on webhook update

* code cleanup

* generate webhook id in config flow

* fix merge

* undo var rename

* remove

* ruff

* ruff

* only delete specific webhook

* clarify warning

* version bump

* minor improvements

* requested changes

* unregister function

* move more of unregistration logic

* test pushed data

* add comment

* Update config_flow.py

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

* ruff

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-01-26 10:48:16 +01:00
Joost Lekkerkerker d4ac5e492b
Add entity registry test to Withings (#108900) 2024-01-26 09:33:56 +01:00
Christophe Gagnier b91e9edd16
Remove "max_current" from TechnoVE sensors (#108898) 2024-01-26 09:05:36 +01:00
J. Nick Koston dff5e45761
Small speed up to listing config entries in the websocket api (#108892) 2024-01-25 20:20:19 -10:00
J. Nick Koston 9de8409f48
Speed up security filter middleware (#108703)
* Speed up security filter middleware

Check the path and query string with the filter expression once instead
of checking the path and query string seperately. If we get a hit than
we check the query string to ensure we give a more verbose error about
where the filter hit.

Additionally since we see the same urls over and over, cache the unquote

* request.url is to expensive, cheaper to join

* aiohttp has a path_qs fast path

* construct the string outselves so it functions exactly as before
2024-01-26 00:17:18 -05:00
J. Nick Koston 617e8dd8a5
Small cleanup to entity platform translation fetching (#108890)
* Small cleanup to entity platform translation fetching

While I could not realize the performance improvemnet I had
hoped in #108800, I pulled this out since its a nice cleanup to avoid
constructing the inner function over and over.

* stale docstring
2024-01-26 00:14:44 -05:00
David F. Mulcahey 3f31a76692
Apply consistent naming to ZHA cluster handler implementations (#108851)
* Apply consistent naming to ZHA cluster handler implentations

* remove import alias

* remove if statement around assert in test
2024-01-25 20:09:38 -05:00
Massimo Savazzi eb85f469e9
Add binary sensor platform to JVC Projector (#108668)
* JVC Projector Binary Sensor

* Fixed PR as per request, removed Name, removed Read_Only.

* Fixed as per Joostlek suggestions

* Update homeassistant/components/jvc_projector/coordinator.py

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

* Update homeassistant/components/jvc_projector/binary_sensor.py

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

* Added changes as per requests

* fixed docstring

* Update homeassistant/components/jvc_projector/strings.json

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

* Update homeassistant/components/jvc_projector/binary_sensor.py

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

* Added icon property to binary sensor. Removed icons.json file as not used anymore

* Fixed tests

* Added icons file

* Update homeassistant/components/jvc_projector/icons.json

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

* Update test_binary_sensor.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-01-25 22:49:03 +01:00
Simone Chemelli e1b1bb070d
Bump aiocomelit to 0.8.2 (#108862)
* bump aicomelit to 0.8.1

* bump to 0.8.2
2024-01-25 21:40:06 +01:00
J. Nick Koston 3447e7fddb
Fix ESPHome color modes for older firmwares (#108870) 2024-01-25 10:18:53 -10:00
Jonas Fors Lellky 2b799830db
Add switch to flexit bacnet integration (#108866)
* Add platform switch to flecit_bacnet integration

* Move testing of the switch to it’s own test

* Assert correct method is called one time

* Test switch on/off error recovery

* Review comment
2024-01-25 20:59:36 +01:00
Diogo Gomes 12289f172d
Filter only utility_meter select entities in reset service (#108855)
filter reset service to only utility_meters
2024-01-25 20:46:45 +01:00
dougiteixeira 7713cf377d
Add utility meter option for the sensor to always be available (#103481)
* Adds option for the sensor to always be available

* Remove logger debug

* Add migration config entry version

* Update homeassistant/components/utility_meter/config_flow.py

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

* Update homeassistant/components/utility_meter/sensor.py

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

* Remove migration config entry version

* Change CONF_SENSOR_ALWAYS_AVAILABLE optional in CONFIG_SCHEMA

* Remove CONF_SENSOR_ALWAYS_AVAILABLE in tests

* Remove CONF_SENSOR_ALWAYS_AVAILABLE in tests

* Remove CONF_SENSOR_ALWAYS_AVAILABLE in tests

* Add option in yaml

* Update homeassistant/components/utility_meter/strings.json

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

* Update homeassistant/components/utility_meter/strings.json

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

* Changes tests

* Add test_always_available

* Use freezegun

* Update homeassistant/components/utility_meter/strings.json

---------

Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-01-25 20:46:33 +01:00
suaveolent faad9a7584
Add ConfigFlow for Lupusec (#108740)
* init support for config flow for lupusec

* correctly iterate over BinarySensorDeviceClass values for device class

* bump lupupy to 0.3.2

* Updated device info for lupusec

* revert bump lupupy for separate pr

* fixed lupusec test-cases

* Change setup to async_setup

* remove redundant check for hass.data.setdefault

* init support for config flow for lupusec

* correctly iterate over BinarySensorDeviceClass values for device class

* bump lupupy to 0.3.2

* Updated device info for lupusec

* revert bump lupupy for separate pr

* fixed lupusec test-cases

* Change setup to async_setup

* remove redundant check for hass.data.setdefault

* resolve merge error lupupy

* connection check when setting up config entry

* removed unique_id and device_info for separate pr

* changed name to friendly name

* renamed LUPUSEC_PLATFORMS to PLATFORMS

* preparation for code review

* necessary changes for pr

* changed config access

* duplicate entry check

* types added for setup_entry and test_host_connection

* removed name for lupusec system

* removed config entry from LupusecDevice

* fixes for sensors

* added else block for try

* added integration warning

* pass config to config_flow

* fix test cases for new config flow

* added error strings

* changed async_create_entry invocation

* added tests for exception handling

* use parametrize

* use parametrize for tests

* recover test

* test unique id

* import from yaml tests

* import error test cases

* Update tests/components/lupusec/test_config_flow.py

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

* fixed test case

* removed superfluous test cases

* self._async_abort_entries_match added

* lib patching call

* _async_abort_entries_match

* patch lupupy lib instead of test connection

* removed statements

* test_flow_source_import_already_configured

* Update homeassistant/components/lupusec/config_flow.py

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

* removed unique_id from mockentry

* added __init__.py to .coveragerc

---------

Co-authored-by: suaveolent <suaveolent@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-01-25 18:52:30 +01:00
Michael bb8828c86f
Address late review on auth (#108852) 2024-01-25 18:15:35 +01:00
Frank Wickström 1b7109fb95
Bump pyhuum to 0.7.10 (#108853)
* Upgrade pyhuum 0.7.9 -> 0.7.10

This fixes dependency issues with Black and ruff

* Update requirements_all.txt

* Update requirements_test_all.txt

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-01-25 17:52:03 +01:00
mkmer 24c9bddae0
Bump blinkpy to 0.22.6 (#108727)
Remove update after snap - now handled in library
2024-01-25 15:23:37 +01:00
David F. Mulcahey 74a60929e4
Use Zigpy definition objects in ZHA cluster handlers (#108383)
* use zigpy def objects in ZHA cluster handlers

* shorten with direct imports

* shorten with rename due to clash
2024-01-25 08:47:26 -05:00
TheJulianJES 4138b5c308
Reduce log level for creating ZHA cluster handler (#108809) 2024-01-25 08:45:11 -05:00
Martin Hjelmare 53b73bd0bd
Make device tracker latitude and longitude optional (#108838)
* Make device tracker latitude and longitude optional

* Update test
2024-01-25 13:25:17 +01:00
Duco Sebel 1fa7ceede3
Use entity translations placeholders in HomeWizard (#108741)
* Adopt Entity placeholders

* Undo some snapshot changes
2024-01-25 13:15:20 +01:00
Cody C 6e59568ba3
Use feed name as entity name in GeoJSON (#108753)
* Add support for entity name in GeoJSON

Previously GeoJSON names were just the config entry ID. This is not very user friendly. Particularly so when there are many config entries and many, many entities from those same many config entries.

* Update GeoJSON tests to support entity names
2024-01-25 13:05:07 +01:00
Frank Wickström 6f81d21a35
Add Huum integration (#106420)
* Add Huum integration

* Use DeviceInfo instead of name property for huum climate

* Simplify entry setup for huum climate entry

* Don’t take status as attribute for huum climate init

* Remove unused import

* Set unique id as entity id in huum init

* Remove unused import for huum climate

* Use entry ID as unique ID for device entity

* Remove extra newline in huum climate

* Upgrade pyhuum to 0.7.4

This version no longer users Pydantic

* Parameterize error huum tests

* Update all requirements after pyhuum upgrade

* Use Huum specific naming for ConfigFlow

* Use constants for username and password in huum config flow

* Use constants for temperature units

* Fix typing and pylint issues

* Update pyhuum to 0.7.5

* Use correct enums for data entry flow in Huum tests

* Remove test for non-thrown CannotConnect in huum flow tests

* Refactor failure config test to also test a successful flow after failure

* Fix ruff-format issues

* Move _status outside of __init__ and type it

* Type temperature argument for _turn_on in huum climate

* Use constants for auth in huum config flow test

* Refactor validate_into into a inline call in huum config flow

* Refactor current and target temperature to be able to return None values

* Remove unused huum exceptions

* Flip if-statment in async_step_user flow setup to simplify code

* Change current and target temperature to be more future proof

* Log exception instead of error

* Use custom pyhuum exceptions

* Add checks for duplicate entries

* Use min temp if no target temp has been fetched yet when heating huum

* Fix tests so that mock config entry also include username and password

* Fix ruff styling issues

I don’t know why it keeps doing this. I run `ruff` locally, and then it does not complain, but CI must be doing something else here.

* Remove unneded setting of unique id

* Update requirements

* Refactor temperature setting to support settings target temparature properly
2024-01-25 12:55:55 +01:00
Brett Adams 909cdc2e5c
Add Teslemetry Integration (#108147)
* Copy Paste Find Replace

* Small progress

* wip

* more wip

* Add SSE listen and close

* More rework

* Fix coordinator

* Get working

* Bump to 0.1.3

* Push to 0.1.4

* Lots of fixes

* Remove stream

* Add wakeup

* Improve set temp

* Be consistent with self

* Increase polling until streaming

* Work in progress

* Move to single climate

* bump to 0.2.0

* Update entity

* Data handling

* fixes

* WIP tests

* Tests

* Delete other tests

* Update comment

* Fix init

* Update homeassistant/components/teslemetry/entity.py

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

* Add Codeowner

* Update coverage

* requirements

* Add failure for subscription required

* Add VIN to model

* Add wake

* Add context manager

* Rename to wake_up_if_asleep

* Remove context from coverage

* change lock to context

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

* Improving Logger

* Add url to subscription error

* Errors cannot markdown

* Fix logger

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

* rename logger

* Fix error logging

* Apply suggestions from code review

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-01-25 12:54:47 +01:00
Joost Lekkerkerker 114bf0da34
Update Lutron in callback (#108779)
* Update Lutron in callback

* Update Lutron in callback

* Remove abstractmethod

* Don't do IO in constructor

* Split fetching and setting
2024-01-25 12:54:31 +01:00
Duco Sebel 0c9a30ab69
Add support for externally connected utility devices in HomeWizard (#100684)
* Backport code from #86386

* Add tests

* Remove local dev change

* Implement device class validation based on unit

* Swap sensor and externalsensor classes (based on importance)

* Use translations for external sensor entities

* Re-add meter identifier as sensor for external devices

* Add migration for Gas identifier

* Rename HomeWizardExternalIdentifierSensorEntity class

* Fix all existing tests

* Reimplement tests for extenal devices with smapshots

* Remove non-used 'None' type in unit

* Add migration test

* Clean up parameterize

* Add test to fix last coverage issue

* Fix non-frozen mypy issue

* Set device name via added EntityDescription field

* Remove device key translations for external sensors,

* Bring back translation keys

* Set device unique_id as serial number

* Remove meter identifier sensor

* Simplify external device initialization

* Adjust tests

* Remove unused gas_meter_id migration

* Remove external_devices redaction

* Remove old gas meter id sensor after migration
2024-01-25 12:51:50 +01:00
RoboMagus c54b65fdf0
Add 'last_reset' for 'total' state_class template sensor (#100806)
* Add last_reset to trigger based template sensors

* Add last_reset to state based template sensors

* CI check fixes

* Add pytests

* Add test cases for last_reset datetime parsing

* Add test for static last_reset value

* Fix ruff-format
2024-01-25 11:12:03 +01:00
Teemu R 3965f20526
Bump python-kasa to 0.6.1 (#108831) 2024-01-25 10:50:01 +01:00
dependabot[bot] 7efc82b14c
Bump dorny/paths-filter from 2.11.1 to 2.12.0 (#108826)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-25 10:36:13 +01:00
J. Nick Koston 82d21136bd
Do not try to cleanup invalid config entries without an AccessoryPairingID (#108830) 2024-01-24 22:49:27 -10:00
Erik Montnemery da7d2ef228
Fix light color mode in zwave_js (#108783) 2024-01-25 09:46:22 +01:00
Martin Hjelmare fabf8802f5
Fix matter color modes (#108804)
* Fix matter light color modes

* Make onoff light fixture only onoff

* Make dimmable light only a dimmable light

* Make color temp light fixture only a color temp light
2024-01-25 09:15:38 +01:00
Josef Zweck c9bef39c9a
Update pytedee_async to 0.2.12 (#108800) 2024-01-25 08:47:05 +01:00
Robert Svensson 195ef6d769
Fix lights reporting unsupported colormodes in deCONZ (#108812) 2024-01-25 08:38:57 +01:00
J. Nick Koston 0628546a0e
Add basic tests for powerview scenes (#108818) 2024-01-24 17:50:06 -10:00
J. Nick Koston c01e8288c1
Convert http auth internals to normal functions (#108815)
Nothing was being awaited here anymore, these can be normal functions
2024-01-24 22:34:52 -05:00