Commit Graph

2495 Commits (13385912d13e178590dc0653df2737c14690383b)

Author SHA1 Message Date
epenet 39f618d5e5
Add snapshot tests to nuki (#117973) 2024-05-24 10:36:59 +02:00
Evgeny 24d31924a0
Migrate OpenWeaterMap to new library (support API 3.0) (#116870)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-23 21:51:10 -10:00
epenet 8da799e420
Move omnilogic coordinator to separate module (#118014) 2024-05-24 08:48:05 +02:00
epenet 4ee1460eec
Move moehlenhoff_alpha2 coordinator to separate module (#117970) 2024-05-23 21:06:00 +02:00
epenet 6b2ddcca5e
Move rainmachine coordinator to separate module (#117983)
* Move rainmachine coordinator to separate module

* Coverage
2024-05-23 16:41:50 +02:00
epenet bc51a4c524
Add snapshot tests to moehlenhoff_alpha2 (#117967)
* Add tests to moehlenhoff_alpha2

* Adjust coverage

* Adjust coverage

* Adjust coverage

* Adjust patch

* Adjust
2024-05-23 11:54:20 +02:00
dontinelli 6682244abf
Improve fyta tests (#117661)
* Add test for init

* update tests

* split common.py into const.py and __init__.py

* Update tests/components/fyta/__init__.py

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

* add autospec, tidy up

* adjust len-test

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-23 10:51:30 +02:00
Michael 6d3cafb43b
Move entity definitions into own module in AVM Fritz!Tools (#117701)
* move entity definitions into own module

* merge entity description mixin

* add entity.py to .coveragerc
2024-05-18 22:25:25 +02:00
epenet 4dad9c8859
Move plenticore coordinators to separate module (#117491) 2024-05-18 13:11:22 +02:00
epenet a904557bbb
Move philips_js coordinator to separate module (#117561) 2024-05-18 10:21:22 +02:00
Christopher Tremblay b015dbfccb
Add AlarmDecoder device info (#117357)
* Update AlarmDecoder component to newer model

This commit makes AlarmDecoder operate as a proper device entity following the new model introduced a few years ago.

Code also has an internal dependency on a newer version of adext (>= 0.4.3) which has been updated correspondingly.

* Created AlarmDecoder entity

Added an alarmdecoder entity so the device_info can be re-used across the integration

* Move _attr_has_entity_name to base entity

As per code review suggestion, clean up the object model.

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

* Missed one suggestion with the prior commit

Moves _attr_has_entity_name to base entity

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

* Address some ruff issues

* Apply additional ruff cleanups

Ran ruff again to clean up a few files tat weren't picked up last time

* Apply suggestions from code review

Some additional cleanup of style & removal of unnecessary code

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

* Properly generated the integration file

generation had to happen twice for this to work.  Now that it's generated, I'm including the missing update.

* Apply suggestions from code review

Use local client variable instead of self._client

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

* Sort the manifest

documentation was added, but it wasn't sorted properly in the key/value pairs

* Add alarmdecoder entity file to coverage ignore file

Added the alarmdecoder entity file so it is ignored for coverage

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-05-18 08:59:44 +02:00
epenet a29a0a36e5
Move elmax coordinator to separate module (#117425) 2024-05-17 16:02:19 +02:00
epenet eacbebce22
Prevent `const.py` in coverage ignore list (#117625) 2024-05-17 12:53:58 +02:00
epenet 407d0f88f0
Rename openweathermap coordinator module (#117609) 2024-05-17 08:05:11 +02:00
Joost Lekkerkerker 68b7302cdc
Add Poolsense platform tests (#117579) 2024-05-16 21:35:00 +02:00
epenet c2bf4b905c
Move surepetcare coordinator to separate module (#117544) 2024-05-16 11:44:36 +02:00
epenet 2cd9bc1c2c
Move xbox coordinator to separate module (#117421) 2024-05-16 09:10:41 +02:00
epenet 0a625baeed
Rename fritz coordinator module (#117440)
* Rename fritz coordinator module

* Update .coveragerc

* Adjust .coveragerc

* Adjust coverage

* Adjust coverage
2024-05-15 21:58:29 +02:00
epenet aa2485c7b9
Move vallox coordinator to separate module (#117503)
* Move vallox coordinator to separate module

* Move logic into coordinator class

* Adjust
2024-05-15 21:01:21 +02:00
Marlon 3604a34823
Post review comments on APsystems (#117504)
* Cleanup for apsystems and fix for strings

* Migrate to typed ConfigEntry Data for apsystems

* Improve strings for apsystems

* Improve config flow tests for apsystems by cleaning up fixtures

* Do not use Dataclass for Config Entry Typing

* Improve translations for apsystems by using sentence case and removing an apostrophe

* Rename test fixture and remove unnecessary comment in tests from apsystems

* Remove default override with default in coordinator from apsystems
2024-05-15 19:56:12 +02:00
epenet 4e600b7b19
Move venstar coordinator to separate module (#117500) 2024-05-15 15:18:26 +02:00
epenet 6c892b227b
Rename mikrotik coordinator module (#117488) 2024-05-15 12:02:33 +02:00
Erik Montnemery e6296ae502
Revert "Add Viam image processing integration" (#117477) 2024-05-15 09:20:40 +02:00
Marlon d4d30f1c46
Add integration for APsystems EZ1 microinverter (#114531)
* Add APsystems local API integration

* Fix session usage in config_flow in apsystems local api

* Remove skip check option for apsystems_loca api

* Update APsystems API dependency and increased test coverage to 100%

* Utilize EntityDescriptions for APsystems Local integration

* Ensure coverage entries are sorted (#114424)

* Ensure coverage entries are sorted

* Use autofix

* Adjust

* Add comment to coverage file

* test CI

* revert CI test

---------

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

* Use patch instead of Http Mocks for APsystems API tests

* Fix linter waring for apsystemsapi

* Fix apsystemsapi test

* Fix CODEOWNERS for apsystemsapi

* Address small PR review changes for apsystems_local

* Remove wrong lines in coveragerc

* Add serial number for apsystems_local

* Remove option of custom refresh interval fro apsystems_local

* Remove function override and fix stale comments

* Use native device id and name storage instead of custom one for apsystems_local

* Use runtime_data for apsystems_local

* Don't store entry data in runtime data

* Move from apsystems_local to apsystems domain

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-05-14 22:50:25 -04:00
Nick Hehr 55bf0b6647
Add Viam image processing integration (#101786)
* feat: scaffold integration, configure client

* feat: register services, allow API key auth flow

* feat: register detection, classification services

* test(viam): add test coverage

* chore(viam): update viam-sdk version

* fix(viam): add service schemas and translation keys

* test(viam): update config flow to use new selector values

* chore(viam): update viam-sdk to 0.11.0

* feat: add exceptions translation stings

* refactor(viam): use constant keys, defer filesystem IO execution

* fix(viam): add missing constants, resolve correct image for services

* fix(viam): use lokalize string refs, resolve more constant strings

* fix(viam): move service registration to async_setup

* refactor: abstract services into separate module outside of manager

* refactor(viam): extend common vol schemas

* refactor(viam): consolidate common service values

* refactor(viam): replace FlowResult with ConfigFlowResult

* chore(viam): add icons.json for services

* refactor(viam): use org API key to connect to robot

* fix(viam): close app client if user abort config flow

* refactor(viam): run ruff formatter

* test(viam): confirm 100% coverage of config_flow

* refactor(viam): simplify manager, clean up config flow methods

* refactor(viam): split auth step into auth_api & auth_location

* refactor(viam): remove use of SelectOptionDict for auth choice, update strings

* fix(viam): use sentence case for translation strings

* test(viam): create mock_viam_client fixture for reusable mock
2024-05-14 13:35:56 +02:00
Federico D'Amico 746cfd3492
Add climate platform to microBees (#111152)
* Add climate platform to microBees

* add list comprehension

* fixes

* fixes

* fixes

* fix multiline ternary

* use a generator expression instead of filter + lambda.

* bug fixes

* Update homeassistant/components/microbees/climate.py

---------

Co-authored-by: Marco Lettieri <m.lettieri@microbees.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-14 12:11:19 +02:00
Laurence Presland c3f95a4f7a
Implement support for SwitchBot Meter, MeterPlus, and Outdoor Meter (#115522)
* Implement support for SwitchBot MeterPlus

Add temperature, humidity, and battery sensor entities for the MeterPlus device

* Rename GH username

* Update homeassistant/components/switchbot_cloud/coordinator.py

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

* Refactor to use EntityDescriptions

Concat entity ID in SwitchBotCloudSensor init

* Remove __future__ import

* Make scan interval user configurable

* Add support for Meter and Outdoor Meter

* Revert "Make scan interval user configurable"

This reverts commit e256c35bb7.

* Remove device-specific default scan intervals

* Update homeassistant/components/switchbot_cloud/sensor.py

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

* Update homeassistant/components/switchbot_cloud/sensor.py

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

* Update homeassistant/components/switchbot_cloud/sensor.py

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

* Fix ruff errors

* Reorder manifest keys

* Update CODEOWNERS

* Add sensor.py to coveragerc

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-13 15:18:28 +02:00
Jan Bouwhuis a1bc929421
Migrate Tibber notify service (#116893)
* Migrate tibber notify service

* Tests and repair flow

* Use notify repair flow helper

* Cleanup strings after using helper, use HomeAssistantError

* Add entry state assertions to unload test

* Update comment

* Update comment
2024-05-12 19:52:08 +02:00
Kevin Worrel c1f0ebee2c
Add screenlogic service tests (#116356) 2024-05-09 07:19:58 -05:00
Jake Martin 6e024d54f1
Add Monzo integration (#101731)
* Initial monzo implementation

* Tests and fixes

* Extracted api to pypi package

* Add app confirmation step

* Corrected data path for accounts

* Removed useless check

* Improved tests

* Exclude partially tested files from coverage check

* Use has_entity_name naming

* Bumped monzopy to 1.0.10

* Remove commented out code

* Remove reauth from initial PR

* Remove useless code

* Correct comment

* Remove reauth tests

* Remove device triggers from intial PR

* Set attr outside constructor

* Remove f-strings where no longer needed in entity.py

* Rename field to make clearer it's a Callable

* Correct native_unit_of_measurement

* Remove pot transfer service from intial PR

* Remove reauth string

* Remove empty fields in manifest.json

* Freeze SensorEntityDescription and remove Mixin

Also use list comprehensions for producing sensor lists

* Use consts in application_credentials.py

* Revert "Remove useless code"

Apparently this wasn't useless

This reverts commit c6b7109e47202f866c766ea4c16ce3eb0588795b.

* Ruff and pylint style fixes

* Bumped monzopy to 1.1.0

Adds support for joint/business/etc account pots

* Update test snapshot

* Rename AsyncConfigEntryAuth

* Use dataclasses instead of dictionaries

* Move OAuth constants to application_credentials.py

* Remove remaining constants and dependencies for services from this PR

* Remove empty manifest entry

* Fix comment

* Set device entry_type to service

* ACC_SENSORS -> ACCOUNT_SENSORS

* Make value_fn of sensors return StateType

* Rename OAuthMonzoAPI again

* Fix tests

* Patch API instead of integration for unavailable test

* Move pot constant to sensor.py

* Improve type safety in async_get_monzo_api_data()

* Update async_oauth_create_entry() docstring

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-07 20:38:58 +02:00
G Johansson b3008b074e
Remove ambiclimate integration (#116410) 2024-05-06 22:15:04 +02:00
Mr. Bubbles b53081dc51
Add update coordinator for Habitica integration (#116427)
* Add DataUpdateCoordinator and exception handling for service

* remove unnecessary lines

* revert changes to service

* remove type check

* store coordinator in config_entry

* add exception translations

* update HabiticaData

* Update homeassistant/components/habitica/__init__.py

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

* Update homeassistant/components/habitica/sensor.py

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

* remove auth exception

* fixes

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-05 17:02:28 +02:00
Joost Lekkerkerker a2bd045c9d
Improve coordinator in Ondilo ico (#116596)
* Improve coordinator in Ondilo ico

* Improve coordinator in Ondilo ico
2024-05-02 15:57:47 +02:00
Manuel Dipolt 2beab34de8
Add sensor platform to romy integration (#112388)
* poc romy status sensor working

* poc romy adc sensor working

* code review changes

* code review changes base enitity.py see branch romy_binary_sensor

* code review change: move CoordinatorEntity to the base class

* code review changes: sensors disabled per default

* code review: icons.json added

* checkout main entity.py

* code review changes: sensors enabled per default again

* disable rssi sensor per default

* Update homeassistant/components/romy/strings.json

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

* code review changes

* code review changes

* code review changes

* pylint fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-24 17:06:46 +02:00
Manuel Dipolt 220dc1f125
Add binary sensor platform to romy integration (#112998)
* wip

* poc working, reworked to a binary sensor list

* Update homeassistant/components/romy/binary_sensor.py

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

* Update homeassistant/components/romy/binary_sensor.py

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

* Update homeassistant/components/romy/binary_sensor.py

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

* Update homeassistant/components/romy/binary_sensor.py

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

* Update homeassistant/components/romy/binary_sensor.py

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

* code review changes, adjust translation key names

* code review clean up: removed unecessary RomyBinarySensorEntityDescription

* code review changes: translation names

* code review changes, put DeviceInfo into RomyEntity

* code review change: change docked icon to type plug

* code review change: move CoordinatorEntity to the base class

* code review changes: sensors disabled per default

* code review: icons.json added

* code review changes: sensors enabled per default again

* checkout main entity.py

* type hinting changes

* Update homeassistant/components/romy/binary_sensor.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-24 15:59:09 +02:00
osohotwateriot 44208a5be0
Add OSO Energy sensors (#108226)
* Add OSO Energy sensors

* Fix comments

* Fixes after review

* Fix sensor names and translations

* Fixes after review

* Fix validation errors

* Fixes after review

* Remove profile sensor
2024-04-24 08:19:26 +02:00
Michael 35db2e4101
Complete test coverage for Tankerkonig (#115920)
* complete tests

* update snapshots after rebase
2024-04-23 23:42:17 +02:00
Joost Lekkerkerker 2977ec4872
Add event platform to Lutron (#109121)
* Add event platform to Lutron

* Add event platform to Lutron

* Fix

* Fix

* Fix

* Add deprecation note

* Fix

* Fix

* Update homeassistant/components/lutron/event.py

* Update homeassistant/components/lutron/event.py

* Fix
2024-04-23 11:54:19 +02:00
Quentame f927b27ed4
Add Epic Games Store integration (#104725)
* Add Epic Games Store integration

Squashed commit of the following PR: #81167

* Bump epicstore-api to 0.1.7 as it handle better error 1004

Thanks to d7469f7c99

* Use extra_state_attributes instead of overriding state_attributes

* Review: change how config_flow.validate_input is handled

* Use LanguageSelector and rename locale to language

* Review: init-better use of hass.data.setdefault

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

* Review: don't need to update at init

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

* Revert "Review: don't need to update at init" --> not working otherwise

This reverts commit 1445a87c8e9b7247f1c9835bf2e2d7297dd02586.

* Review: fix config_flow.validate_input/retactor following lib bump

* review: merge async_update function with event property

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

* hassfest

* Fix duplicates data from applied comment review 5035055

* review: thanks to 5035055 async_add_entities update_before_add param is not required anymore

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

* Fix Christmas special "Holiday sale" case

* gen_requirements_all

* Use CONF_LANGUAGE from HA const

* Move CalendarType to const

* manifest: integration_type -> service

Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>

* calendar: remove date start/end assert

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

* const: rename SUPPORTED_LANGUAGES

* hassfest

* config: Move to ConfigFlowResult

* coordinator: main file comment

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

* ruff & hassfest

* review: do not guess country

* Add @hacf-fr as codeowner

* review: remove games extra_attrs
Was dropped somehow:
- 73c20f34803b0a0ec242bf0740494f17a68f6f59 review: move games extra_attrs to data service
- other commit that removed the service part

* review: remove unused error class
was removed:
- 040cf945bb5346b6d42b3782b5061a13fb7b1f6b

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-04-22 09:54:47 +02:00
epenet bea4c52d10
Ignore coverage for aiohttp_resolver backport helper (#115177)
* Ignore coverage for aiohttp_resolver backport helper

* Adjust generate to sort core items

* Adjust validate to sort core items

* Split line

* Apply suggestion

Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>

* Fix suggestion

---------

Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
2024-04-12 16:33:05 +02:00
Joost Lekkerkerker 80450adb1a
Remove Epson Workforce integration (#115201)
* Remove Epson Workforce integration

* Remove Epson Workforce integration
2024-04-09 10:38:17 +02:00
Robert Contreras af7d0187cb
Add tests to Home Connect integration (#114214)
* Add tests to Home Connect integration

* Fix misspelling

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

* Changes to tests with properly setup fixtures.

* Consolidated api tests, patched library instead of code

* Consolidate sensor edge cases, switch mock assertion to call_count

* Adjust assertion

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-09 08:52:39 +02:00
Jan Bouwhuis 2e3cb1a767
Correct changes hassfest coverage backports (#115044) 2024-04-06 21:17:44 +02:00
Joost Lekkerkerker 57cc3495c2
Sort coveragerc again (#115017)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-04-06 15:51:56 +02:00
J. Nick Koston f497c461ed
Switch to using the AsyncResolver with aiohttp (#114529)
* Bump aiodns to 3.2.0

changelog: https://github.com/saghul/aiodns/compare/v3.1.1...v3.2.0

* Switch to using the AsyncResolver with aiohttp

This avoids creating executor jobs to do DNS resolution

AsyncResolver was not usable before https://github.com/aio-libs/aiohttp/pull/8270
because it did not fallback to fallback to A records and only returned AAAA records
in most cases when IPv6 was available

This is a backport of https://github.com/aio-libs/aiohttp/pull/8270

* Switch to using the AsyncResolver with aiohttp

This avoids creating executor jobs to do DNS resolution

AsyncResolver was not usable before https://github.com/aio-libs/aiohttp/pull/8270
because it did not fallback to fallback to A records and only returned AAAA records
in most cases when IPv6 was available

This is a backport of https://github.com/aio-libs/aiohttp/pull/8270

* Switch to using the AsyncResolver with aiohttp

This avoids creating executor jobs to do DNS resolution

AsyncResolver was not usable before https://github.com/aio-libs/aiohttp/pull/8270
because it did not fallback to fallback to A records and only returned AAAA records
in most cases when IPv6 was available

This is a backport of https://github.com/aio-libs/aiohttp/pull/8270

* Switch to using the AsyncResolver with aiohttp

This avoids creating executor jobs to do DNS resolution

AsyncResolver was not usable before https://github.com/aio-libs/aiohttp/pull/8270
because it did not fallback to fallback to A records and only returned AAAA records
in most cases when IPv6 was available

This is a backport of https://github.com/aio-libs/aiohttp/pull/8270

* fixes

* fix mocking in next_dns

* fix unmocked calls in blink

* more mocking fixes

* more fixes

* more fixes

* Fix missing mocking in nextdns tests

extracted from #114539

* extract from context
2024-04-05 23:15:51 -04:00
Jan-Philipp Benecke 613bdebfe5
Migrate sabnzbd to use data update coordinator (#114745)
* Migrate sabnzbd to use data update coordinator

* Add to coveragerc

* Setup coordinator after migration

* Use kB/s as UoM

* Add suggested
2024-04-03 15:15:23 +02:00
Aidan Timson 17f0002549
Azure DevOps integration tests (#114577)
* Add tests to azure devops

* Remove Azure DevOps files from coverage

* Add assertion for entity registration in test_sensors()

* Remove unnecessary code in test_sensor.py

* Refactor test_sensors function

* Fix

* Test unique id

* Refactor

* Refactor reauth_flow test in azure_devops module

* Suggested changes, batched

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

* Changes

* Use snapshot

* Remove redundant entry fetch

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-02 21:23:55 +02:00
Joakim Sørensen a1ae4ec23d
Add sensor entities to Traccar Server (#111374) 2024-04-02 12:11:28 +02:00
epenet ad3577804b
Ensure coverage entries are sorted (#114424)
* Ensure coverage entries are sorted

* Use autofix

* Adjust

* Add comment to coverage file

* test CI

* revert CI test

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-01 14:12:24 +02:00
Lennard Beers 282cbfc048
Add eq3btsmart integration (#109291)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-28 15:20:56 -10:00