Commit Graph

503 Commits (59e5eb9a1c8cc37e757e9ccc0d05ccd3b9cf16c9)

Author SHA1 Message Date
Marc Mueller e6bba49bcd
Add strict typing for govee_ble (#128044) 2024-10-09 19:29:42 +02:00
Marc Mueller 2d093e9692
Enable strict typing for switch_as_x (#127998) 2024-10-09 16:00:45 +02:00
Marc Mueller 412acf943d
Enable strict typing for panel_custom (#127855) 2024-10-08 08:16:58 +02:00
Marc Mueller 00ee2b4478
Enable strict typing for openai_conversation (#127854) 2024-10-08 08:06:05 +02:00
Marc Mueller c3bf1dde7e
Enable strict typing for shell_command (#127856) 2024-10-08 02:05:41 +03:00
Marc Mueller d185f230b9
Enable strict typing for workday (#127797) 2024-10-07 12:48:12 +02:00
Marc Mueller 079ba2a529
Add strict typing to radio_browser (#127799) 2024-10-07 12:47:08 +02:00
TimL 9eb3d84715
Add Smlight integration to strict-typing (#125946)
Add smlight to strict typing
2024-09-14 11:54:00 +02:00
Joost Lekkerkerker 688da5389c
Mark UVC as strict typed (#123239) 2024-09-10 22:02:46 +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
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
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
Artur Pragacz bad305dcbf
Add Onkyo to strict typing (#124617) 2024-09-04 19:11:34 +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
tronikos f4a16c8dc9
Add strict typing in Google Cloud (#125068) 2024-09-02 04:07:12 -07: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
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
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
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
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
G Johansson dd52f4c84a
Remove deprecated mailbox platform (#123740)
* Remove deprecated mailbox platform

* Remove from const

* Remove from type hints

* Remove from pyproject
2024-08-28 16:41:23 +02:00
G Johansson 11d2258afc
Improve code quality in Manual alarm (#123142)
* Improve code quality in Manual alarm

* Review

* Remove helper

* Remove unique id

* Reset demo and fix unique id

* next_state variable

* Fixes

* Is helper

* Fix unique id

* exception message

* Fix mypy
2024-08-18 21:31:44 +02:00
Antoine Reversat 1afed8ae15
Add Fujitsu FGLair integration (#109335)
* Add support for Fujitsu HVAC devices

* Add the entity code to .coveragerc

* Only include code that can fail in the try/except block

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Remove empty keys from manifest

* Remove VERSION as it's already the default

* Remve the get_devices function and use asyncio.gather to parallelize dev updates

* Move initial step to a function

* Let KeyError bubble up. If we are passed an invalid mode it's probably worth raising an exception.

* Await the gather

* Use the async version of the refresh_auth call

* Use the serial number as unique id

* Use HA constant for precision

* Use dev instead of self._dev

* Move to property decorated methods

* Remove bidict dependency

* Setup one config entry for our api credentials instead of per device

* Remove bidict from requirements

* Signout and remove our api object on unload

* Use app credentials from ayla_iot_unofficial

* Use entry_id as a key to store our API object

* Delete unused code

* Create reverse mappings from forward mapping instead of hardcoding them

* Clean up the property methods

* Only import part of config_entries we are using

* Implement suggested changes

* Fix tests to use new API consts

* Add support for reauth

* Use a coordinator instead of doing per-entity refresh

* Auto is equivalent to HEAT_COOL not AUTO

* Add ON and OFF to list of supported features

* Use the mock_setup_entry fixture for the reauth tests

* Parametrize testing of config flow exceptions

* Only wrap fallable code in try/except

* Add tests for coordinator

* Use self.coordinator_context instead of self._dev.device_serial_number

* Move timeout to ayla_iot_unofficial

* Add description for is_europe field

* Bump version of ayla-iot-unofficial

* Remove turn_on/turn_off warning

* Move coordinator creating to __init__

* Add the type of coordinator to the CoordiatorEntity

* Update docstring for FujitsuHVACDevice constructor

* Fix missed self._dev to dev

* Abort instead of showing the form again with an error when usernames are different

* Remove useless argument

* Fix tests

* Implement some suggestions

* Use a device property the maps to the coordinator data

* Fix api sign out when unloading the entry

* Address comments

* Fix device lookup

* Move API sign in to coordinator setup

* Get rid of FujitsuHVACConfigData

* Fix async_setup_entry signature

* Fix mock_ayla_api

* Cleanup common errors

* Add test to check that re adding the same account fails

* Also patch new_ayla_api in __init__.py

* Create a fixture to generate test devices

* Add a setup_integration function that does the setup for a mock config entry

* Rework unit tests for the coordinator

* Fix typos

* Use hass session

* Rework reauth config flow to only modify password

* Update name to be more use-friendly

* Fix wrong type for entry in async_unload_entry

* Let TimeoutError bubble up as teh base class handles it

* Make the mock ayla api return some devices by default

* Move test to test_climate.py

* Move tests to test_init.py

* Remove reauth flow

* Remove useless mock setup

* Make our mock devices look real

* Fix tests

* Rename fujitsu_hvac to fujitsu_fglair and rename the integration to FGLair

* Add the Fujitsu brand

* Add a helper function to generate an entity_id from a device

* Use entity_id to remove hardcoded entity ids

* Add a test to increase code coverage

---------

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Joostlek <joostlek@outlook.com>
2024-08-18 15:37:33 +02:00
dontinelli 8a110abc82
Bump fyta_cli to 0.6.0 (#123816)
* Bump fyta_cli to 0.5.1

* Code adjustments to enable strit typing

* Update homeassistant/components/fyta/__init__.py

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

* Update diagnostics

* Update config_flow + init (ruff)

* Update sensor

* Update coordinator

* Update homeassistant/components/fyta/diagnostics.py

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

* Update homeassistant/components/fyta/diagnostics.py

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

* Update homeassistant/components/fyta/sensor.py

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

* Set one ph sensor to null/none

* Update sensor

* Clean-up (ruff)

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-16 17:46:37 +02:00
Joost Lekkerkerker 42ab8d0445
Remove deprecated asterisk_mbox integration (#123174) 2024-08-05 15:28:49 +02:00
Joost Lekkerkerker 96364f0452
Remove deprecated asterisk_cdr integration (#123180) 2024-08-05 14:43:39 +02:00
Simon 5fefa606b6
Add ElevenLabs text-to-speech integration (#115645)
* Add ElevenLabs text-to-speech integration

* Remove commented out code

* Use model_id instead of model_name for elevenlabs api

* Apply suggestions from code review

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

* Use async client instead of sync

* Add ElevenLabs code owner

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Set entity title to voice

* Rename to elevenlabs

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Allow multiple voices and options flow

* Sort default voice at beginning

* Rework config flow to include default model and reloading on options flow

* Add error to strings

* Add ElevenLabsData and suggestions from code review

* Shorten options and config flow

* Fix comments

* Fix comments

* Add wip

* Fix

* Cleanup

* Bump elevenlabs version

* Add data description

* Fix

---------

Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Michael Hansen <mike@rhasspy.org>
Co-authored-by: Joostlek <joostlek@outlook.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-07-31 21:31:09 +02:00
danielsmyers fa61ad072d
Add Bryant Evolution Integration (#119788)
* Add an integration for Bryant Evolution HVAC systems.

* Update newly created tests so that they pass.

* Improve compliance with home assistant guidelines.

* Added tests

* remove xxx

* Minor test cleanups

* Add a test for reading HVAC actions.

* Update homeassistant/components/bryant_evolution/__init__.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/bryant_evolution/climate.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/bryant_evolution/climate.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/bryant_evolution/climate.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/bryant_evolution/climate.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/bryant_evolution/climate.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/bryant_evolution/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Address reviewer comments.

* Address additional reviewer comments.

* Use translation for exception error messages.

* Simplify config flow.

* Continue addressing comments

* Use mocking rather than DI to provide a for-test client in tests.

* Fix a failure in test_config_flow.py

* Track host->filename in strings.json.

* Use config entry ID for climate entity unique id

* Guard against fan mode returning None in async_update.

* Move unavailable-client check from climate.py to init.py.

* Improve test coverage

* Bump evolutionhttp version

* Address comments

* update comment

* only have one _can_reach_device fn

* Auto-detect which systems and zones are attached.

* Add support for reconfiguration

* Fix a few review comments

* Introduce multiple devices

* Track evolutionhttp library change that returns additional per-zone information during enumeration

* Move construction of devices to init

* Avoid triplicate writing

* rework tests to use mocks

* Correct attribute name to unbreak test

* Pull magic tuple of system-zone into a constant

* Address some test comments

* Create test_init.py

* simplify test_reconfigure

* Replace disable_auto_entity_update with mocks.

* Update tests/components/bryant_evolution/test_climate.py

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

* Update tests/components/bryant_evolution/test_climate.py

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

* Update tests/components/bryant_evolution/test_config_flow.py

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

* Update homeassistant/components/bryant_evolution/config_flow.py

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

* Update tests/components/bryant_evolution/test_config_flow.py

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

* Update tests/components/bryant_evolution/test_config_flow.py

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

* fix test errors

* do not access runtime_data in tests

* use snapshot_platform and type fixtures

---------

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-29 11:25:04 +02:00
Philip Vanloo cde22a44db
Add LinkPlay integration (#113940)
* Intial commit

* Add artsound as virtual integration

* Add config_flow test
Add linkplay to .coveragerc
Add linkplay to .strict-typing

* Remove artsound component

* Bump package version

* Address mypy and coveragerc

* Address comments

* Address more feedback, add zeroconf and user flow

* Catch broken bridge in async_setup_entry

* Raise ConfigEntryNotReady, add __all__

* Implement new tests for the config_flow

* Fix async warning

* Fix test

* Address feedback

* Address comments

* Address comment

---------

Co-authored-by: Philip Vanloo <26272906+pvanloo@users.noreply.github.com>
2024-07-25 12:27:10 +02:00
Paolo Burgio c1c5cff993
Add integration for iotty Smart Home (#103073)
* Initial import 0.0.2

* Fixes to URL, and removed commits

* Initial import 0.0.2

* Fixes to URL, and removed commits

* Added first test for iotty

* First release

* Reviewers request #1
- Removed clutter
- Added support for new naming convention for IottySmartSwitch entity

* Removed commmented code

* Some modifications

* Modified REST EP for iotty CloudApi

* Initial import 0.0.2

* Fixes to URL, and removed commits

* Added first test for iotty

* First release

* Rebased and resolved conflicts

* Reviewers request #1
- Removed clutter
- Added support for new naming convention for IottySmartSwitch entity

* Removed commmented code

* Some modifications

* Modified REST EP for iotty CloudApi

* Removed empty entries in manifest.json

* Added test_config_flow

* Fix as requested by @edenhaus

* Added test_init

* Removed comments, added one assert

* Added TEST_CONFIG_FLOW

* Added test for STORE_ENTITY

* Increased code coverage

* Full coverage for api.py

* Added tests for switch component

* Converted INFO logs onto DEBUG logs

* Removed .gitignore from commits

* Modifications to SWITCH.PY

* Initial import 0.0.2

* Fixes to URL, and removed commits

* Added first test for iotty

* First release

* Rebased and resolved conflicts

* Fixed conflicts

* Reviewers request #1
- Removed clutter
- Added support for new naming convention for IottySmartSwitch entity

* Removed commmented code

* Some modifications

* Modified REST EP for iotty CloudApi

* Removed empty entries in manifest.json

* Added test_config_flow

* Some modifications

* Fix as requested by @edenhaus

* Added test_init

* Removed comments, added one assert

* Added TEST_CONFIG_FLOW

* Added test for STORE_ENTITY

* Increased code coverage

* Full coverage for api.py

* Added tests for switch component

* Converted INFO logs onto DEBUG logs

* Removed .gitignore from commits

* Modifications to SWITCH.PY

* Fixed tests for SWITCH

* First working implementation of Coordinator

* Increased code coverage

* Full code coverage

* Missing a line in testing

* Update homeassistant/components/iotty/__init__.py

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

* Update homeassistant/components/iotty/__init__.py

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

* Modified coordinator as per request by edenhaus

* use coordinator entities for switches

* move platforms to constants

* fix whitespace with ruff-format

* correct iotty entry in application_credentials list

* minor style improvements

* refactor function name

* handle new and deleted devices

* improve code for adding devices after first initialization

* use typed config entry instead of adding known devices to hass.data

* improve iotty entity removal

* test listeners update cycle

* handle iotty as devices and not only as entities

* fix test typing for mock config entry

* test with fewer mocks for an integration test style opposed to the previous unit test style

* remove useless tests and add more integration style tests

* check if device_to_remove is None

* integration style tests for turning switches on and off

* remove redundant coordinator tests

* check device status after issuing command in tests

* remove unused fixtures

* add strict typing for iotty

* additional asserts and named snapshots in tests

* fix mypy issues after enabling strict typing

* upgrade iottycloud version to 0.1.3

* move coordinator to runtime_data

* remove entity name

* fix typing issues

* coding style fixes

* improve tests coding style and assertion targets

* test edge cases when apis are not working

* improve tests comments and assertions

---------

Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Shapour Nemati <shapour.nemati@iotty.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: shapournemati-iotty <130070037+shapournemati-iotty@users.noreply.github.com>
2024-07-19 12:10:39 +02:00
Erik Montnemery 07ceafed62
Enable strict typing on script integration (#122079) 2024-07-17 15:11:06 +02:00
Erik Montnemery efb7bede40
Enable strict typing on script helper (#122075) 2024-07-17 13:51:59 +02:00
Klaas Schoute fce68018b7
Add Autarco integration (#121600)
* Init Autarco integration

* Add integration code with tests

* Update every 5 minutes

* Process all feedback from Joost

* Bump lib to v2.0.0

* Add more then one site if present

* Fix issue with entity translation

* Update the test for sensor entities

* Fix round two based on feedback from Joost

* Add autarco to strict typing

* Update tests/components/autarco/test_config_flow.py

* Update tests/components/autarco/test_config_flow.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-10 23:05:31 +02:00
ilan 12228d8a00
Add madvr envy integration (#120382)
* feat: Add madvr envy

* fix: await and pass entry directly

* fix: add attributes and unique id for sensors

* fix: reflect power state well, improve state detection

* fix: don't connect on init, add options, add reload on change, keep on during test

* fix: cancel tasks on unload

* fix: test connection via library

* fix: wait for boot time

* docs: add readme and license

* fix: broken pipe in lib

* fix: detect out of band power off

* fix: improve extra attributes

* fix: fix unloading, add config flow test, limit to one platform

* fix: use conf, refresh coordinator, other comments

* fix: remove event data

* fix: fix tests passing, remove wake on lan

* fix: dont allow to proceed unless connection works

* chore: update dep

* fix: update config flow, add constants

* fix: write state, use runtime data instead

* fix: remove await

* fix: move unloading and stuff to coordinator/init

* fix: pass in config entry with correct type

* fix: move queue and tasks to library

* fix: config flow error flow, tests, name, and update lib

* fix: update lib, leave connection open on setup

* fix: update lib

* fix: address comments, remove wol from lib

* fix: remove unneeded options

* fix: remove fields

* fix: simplify code, address comments

* fix: move error to lib

* fix: fix test

* fix: stronger types

* fix: update lib

* fix: missing text from options flow

* chore: remove options flow

* chore: remove import

* chore: update comments

* fix: get mac from device, persist

* fix: add mac stuff to test

* fix: startup import errors

* chore: stale comment

* fix: get mac from persisted config

* chore: update lib

* fix: persist mac in a better way

* feat: use mac as unique ID for entry

* fix: use unique ID from mac, add proper device

* fix: will not be set in init potentially

* fix: access mac

* fix: optimize, move error to lib

* feat: add coordinator test, use conf

* fix: use one mock, add init test

* fix: not async

* feat: add remote test

* fix: types

* fix: patch client, expand remote tests

* fix: use snapshot test

* fix: update branding

* fix: add description, fix type check

* fix: update tests

* fix: test

* fix: update test

* fix: camelcase

* Fix

* feat: strict typing

* fix: strict typing in lib

* fix: type will never be None

* fix: reference to mac, all tests passing

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
2024-07-07 20:41:53 +02:00
Luke Lashley 69e0227682
Add Roborock to strict typing (#120379) 2024-06-26 14:13:49 +02:00
Joost Lekkerkerker 2770811dda
Add Knocki integration (#119140)
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
2024-06-21 17:22:03 +02:00
Jafar Atili 9af13e54c1
Bump pyElectra to 1.2.3 (#119369) 2024-06-11 15:05:53 +02:00
Ruben Bokobza 35347929ca
Bump pyElectra to 1.2.1 (#118958) 2024-06-11 07:04:25 +02:00
Angel Nunez Mencias b85cf36a68
Upgrade thethingsnetwork to v3 (#113375)
* thethingsnetwork upgrade to v3

* add en translations and requirements_all

* fix most of the findings

* hassfest

* use ttn_client v0.0.3

* reduce content of initial release

* remove features that trigger errors

* remove unneeded

* add initial testcases

* Exception warning

* add strict type checking

* add strict type checking

* full coverage

* rename to conftest

* review changes

* avoid using private attributes - use protected instead

* simplify config_flow

* remove unused options

* review changes

* upgrade client

* add types client library - no need to cast

* use add_suggested_values_to_schema

* add ruff fix

* review changes

* remove unneeded comment

* use typevar for TTN value

* use typevar for TTN value

* review

* ruff error not detected in local

* test review

* re-order fixture

* fix test

* reviews

* fix case

* split testcases

* review feedback

* Update homeassistant/components/thethingsnetwork/__init__.py

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

* Update homeassistant/components/thethingsnetwork/__init__.py

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

* Update tests/components/thethingsnetwork/test_config_flow.py

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

* Remove deprecated var

* Update tests/components/thethingsnetwork/test_config_flow.py

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

* Remove unused import

* fix ruff warning

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-26 16:30:33 +02:00
Joost Lekkerkerker 0335a01fba
Use runtime data in Poolsense (#117570) 2024-05-16 17:31:14 +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
Joost Lekkerkerker 6485973d9b
Add airgradient integration (#114113) 2024-05-09 10:54:29 +02: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
Maciej Bieniek c46be022c8
Add IMGW-PIB integration (#116468)
* Add sensor platform

* Add tests

* Fix icons.json

* Use entry.runtime_data

* Remove validate_input function

* Change abort reason to cannot_connect

* Remove unnecessary square brackets

* Move _attr_attribution outside the constructor

* Use native_value property

* Use is with ENUMs

* Import SOURCE_USER

* Change test name

* Use freezer.tick

* Tests refactoring

* Remove test_setup_entry

* Test creating entry after error

* Add missing async_block_till_done

* Fix translation key

* Remove coordinator type annotation

* Enable strict typing

* Assert config entry unique_id

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-01 14:38:36 +02:00
Thomas55555 ccc2f6c5b5
Add strict typing to husqvarna automower (#115374) 2024-04-25 15:39:42 -05:00
Thomas Kistler 0dd8ffd1f5
Add a new "Ambient Weather Network" integration (#105779)
* Adding a new "Ambient Weather Network" integration.

* Rebase and update code coverage.

* Addressed some reviewer comments.

* Remove mnemonics and replace with station names.

* Remove climate-utils

* Remove support for virtual stations.

* Rebase

* Address feedback

* Remove redundant errors

* Reviewer feedback

* Add icons.json

* More icons

* Reviewer feedback

* Fix test

* Make sensor tests more robust

* Make coordinator more robust

* Change update coordinator to raise UpdateFailed

* Recover from no station found error

* Dynamically set device name

* Address feedback

* Disable some sensors by default

* Reviewer feedback

* Change from hub to service

* Rebase

* Address reviewer feedback

* Reviewer feedback

* Manually rerun ruff on all files
2024-04-16 09:46:15 +02:00
Steven B 6954fcc8ad
Add strict typing to ring integration (#115276) 2024-04-11 10:10:56 +02:00
Mischa Siekmann 6d54f686a6
Add Integration for Energenie Power-Sockets (#113097)
* Integration for Energenie Power-Strips (EGPS)

* cleanups reocommended by reviewer

* Adds missing exception handling when trying to send a command to an unreachable device.

* fix: incorrect handling of already opened devices in pyegps api. bump to pyegps=0.2.4

* Add blank line after file docstring, and other cosmetics

* change asyncio.to_thread to async_add_executer_job

* raises HomeAssistantError EgpsException in switch services.

* switch test parameterized by entity name

* reoved unused device registry

* add translation_key and update_before_add

* bump pyegps dependency to version to 0.2.5

* combined get_device patches and put into conftest.py

* changed switch entity to use _attr_is_on and cleanups

* further cleanup

* Apply suggestions from code review

* refactor: rename egps to energenie_power_sockets

* updated test snapshot

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-03-29 13:29:14 +01: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