Commit Graph

2078 Commits (4a48f0d6599aafa6e197df78506465750337c08c)

Author SHA1 Message Date
Aarni Koskela 38f183a683
Ruuvi Gateway integration (#84853)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-03 10:19:43 -10:00
Koen van Zuijlen 6349760a2c
Zeversolar integration (#84887)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-01-03 20:14:08 +01:00
amitfin b5664f9eaf
Bump pycoolmasternet-async and add coolmaster swing mode (#82809)
* Add filter and error code support to CoolMastetNet

* Create separate entities

* coolmaster swing_mode support

* Changed default to False

* Raise HomeAssistantError

* Add tests for init and climate

* Fixed bad merge

* Catch only ValueError
2023-01-03 10:21:11 -08:00
epenet 34798189ca
Improve SFR Box test coverage (#85054)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-03 17:56:30 +01:00
Joakim Plate b302d1f3fc
Add initial test for nibe buttons (#84950) 2023-01-02 20:24:20 +01:00
epenet 896526c24b
Add SFR Box integration (#84780)
* Add SFR Box integration

* Adjust error handling in config flow

* Add tests

* Use value_fn

* Add translation

* Enable mypy strict typing

* Add ConfigEntryNotReady

* Rename exception

* Fix requirements
2022-12-31 10:14:13 +01:00
Joakim Plate af875eec50
Add nibe heat pump alarm reset button (#79427)
* Add button platform

* Enable button platform

* Use parameters from library
2022-12-28 15:36:41 +01:00
Damian Sypniewski 599569bc53
Add support for SwitchBot Lock (#84673)
* Added support for SwitchBot Lock

* Updated PySwitchbot to 0.32.1

* Updated .coveragerc

* Removed unnecessary condition

* Using library method to verify encryption key

* Added config flow tests

* Remove link from config flow description

* Added one more test for config flow

* Updated CODEOWNERS
2022-12-27 18:16:00 -10:00
starkillerOG a06b1eaf69
Add reolink IP NVR/Camera integration (#84081)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-12-27 10:15:53 -10:00
Martin Hjelmare dea513cdbd
Add mysensors light tests (#84606) 2022-12-27 15:25:22 +01:00
Martin Hjelmare 941d175087
Add mysensors device tracker tests (#84589) 2022-12-26 12:58:13 -10:00
Martin Hjelmare 101118a60e
Add mysensors binary sensor tests (#84580) 2022-12-26 20:19:15 +01:00
Allen Porter 490d2cfb71
Move Rainbird to async client library (#84417)
* Bump pyrainbird to 0.7.0 and move to async library

* Share updates across sensors

* Fix test version and delete dead code

* Add test coverage for yaml configuration

* Address PR feedback
2022-12-22 13:00:17 -08:00
Martin Hjelmare 6a8d9a91cb
Fix matter websocket reconnect (#84192) 2022-12-20 13:06:24 +01:00
Daniel Gangl 8ca92254b6
Correct zamg config flow comments (#81369)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
fixes undefined
2022-12-20 11:47:32 +01:00
Franck Nijhof 5651f4a3fe
Remove Deutsche Bahn integration (#84236) 2022-12-19 21:43:28 +01:00
Alberto Geniola ecdbddc1fa
Elmax/alarm_control_panel (#75365) 2022-12-18 09:12:43 -07:00
Martin Hjelmare f29024795b
Clean up matter adapter (#84144) 2022-12-17 23:44:19 +01:00
muppet3000 186e3a6d98
Re-add missing Growatt TLX values (#84040)
* Growatt - Re-adding missing TLX values (#81470)

* Growatt - Added missing files to .coveragerc

* Growatt - Correcting TLX Voltage types

* Growatt - Addressing review comments
2022-12-16 15:31:49 +01:00
Aaron Bach e64973c7cc
Add PurpleAir integration (#82110) 2022-12-12 20:32:11 -07:00
Aaron Bach 3d4ee5906d
Add integration for AirVisual Pro (#79770)
* Add integration for AirVisual Pro

* Tests

* A few more redactions

* Loggers

* Consistency

* Remove unnecessary f-string

* Use `entry.as_dict()` in diagnostics

* One call

* Integration types

* Cleanup

* Import cleanup

* Code review

* Code review

* Code review
2022-12-12 14:28:27 -07:00
J. Nick Koston 642cefb035
Add MVP humidifier support to switchbot (#83696)
* Add MVP humidifier support to switchbot

changelog: https://github.com/Danielhiversen/pySwitchbot/compare/0.22.0...0.23.0

* Update homeassistant/components/switchbot/config_flow.py

* bump

* coveragerc

* Revert "coveragerc"

This reverts commit eb642f6543.

* fix dirty branch
2022-12-10 13:56:57 -05:00
Guido Schmitz 500b00bd66
Add sensor tests for devolo_home_control (#74292) 2022-12-08 20:40:45 +02:00
Jevgeni Kiski d62bdbb9ff
Add vallox fan speed control (#82548)
* fan.set_percentage + tests

* let's see what is not yet covered

* Apply suggestions from code review

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

* tests fix

* vallox_websocket_api 3.0.0

* more coverage

* test coverage

* Update tests/components/vallox/test_fan.py

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

* raise exceptions on user input

* Supported features are different per preset mode.

* Test fixes

* Static supported features is back.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-06 11:00:59 +01:00
Aaron Bach cd0037a780
Fix OpenUV coverage (#83203) 2022-12-03 14:40:42 -07:00
Marcel van der Veldt e2308fd15c
Add matter integration BETA (#83064)
* Add matter base (#79372)

Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>

* Add matter server add-on flow (#82698)

* Add matter server add-on flow

* Fix stale error argument

* Clean docstrings

* Use localhost as default address

* Add matter websocket api foundation (#82848)

* Add matter config entry add-on management (#82865)

* Use matter refactored server/client library (#83003)

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

* Bump python-matter-server to 1.0.6 (#83059)

* Extend matter websocket api (#82948)

* Extend matter websocket api

* Finish docstring

* Fix pin type

* Adjust api after new client

* Adjust api to frontend for now

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-01 20:44:56 +01:00
Joakim Plate 9f236c4ca5
Add nibe heat pump climate entities (#78952)
* Add climate platform

* Enable climate plarform

* Some adjustments after review

* fixup! Add climate platform

* Rename description to avoid confusion

* No need to pass None

* Rename with nibe prefix

* Handle possible translations of values

* Make sure we prune None contexts

* Switch to constants from library
2022-12-01 01:58:59 +01:00
Christopher McCurdy 4167edc52d
Create a UUID from given LG soundbar device name (#81918)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Fixes https://github.com/home-assistant/core/issues/77524
fixes undefined
2022-11-30 12:53:49 +01:00
Robert Hillis 8a1805fa89
Add Do Not Disturb sensor to Slack (#72380) 2022-11-27 15:31:38 -05:00
Shay Levy 1e68e8c4b4
Add Shelly tests coverage (#82642)
* Add Shelly tests coverage

* Review comments

* Remove leftovers
2022-11-24 20:07:19 +02:00
Franck Nijhof 285aff154d
Remove Google Chat/Hangouts integration (#82645) 2022-11-24 18:33:13 +01:00
Matrix 95cbf7cca7
Add yolink Dimmer support (#81970)
* Add yolink Dimmer support

* suggest change

* fix suggest

* fix suggest

* fix suggest
2022-11-23 16:27:51 +01:00
Shay Levy 4a089b5c28
Add tests coverage for Shelly climate platform (#82529) 2022-11-22 09:04:55 -06:00
epenet 9d192643ee
Move PluggableAction to trigger helpers (#81900)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Joakim Plate <elupus@ecce.se>
Co-authored-by: Shay Levy <levyshay1@gmail.com>
2022-11-22 11:35:18 +01:00
Shay Levy 91a44b697b
Add tests coverage for Shelly number platform (#82480) 2022-11-21 10:55:06 -06:00
Shay Levy 32f3eb722e
Add tests coverage for Shelly entity (#82432)
* Add tests coverage for Shelly entity

* Make it generator expression
2022-11-20 23:59:25 +02:00
Shay Levy 8bd7f59b93
Add tests for Shelly sensor platform (#82385) 2022-11-19 22:01:30 +02:00
Shay Levy ea98f0e9e8
Add tests for Shelly binary_sensor platform (#82367)
* Add tests for Shelly binary_sensor platform

* Rename create to register for
2022-11-19 18:07:02 +02:00
G Johansson 48f6c9a486
Add tests DNS IP (#82059) 2022-11-13 18:23:14 -06:00
J. Nick Koston b7533aff48
Replace led-ble util with bluetooth-data-tools (#81093) 2022-11-08 07:26:16 -06:00
Nyro ddbfed354e
Add Overkiz AtlanticPassAPCDHW (#78665)
* Add Overkiz AtlanticPassAPCDHW

* Remove unnecessary line

* Improve atlantic pass_apcdhw for operation and target temprature

* Remove async_execute_commands

* Fix small code issues for Overkiz AtlanticPassAPCDHW

* Update homeassistant/components/overkiz/const.py

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>

* Update homeassistant/components/overkiz/water_heater_entities/atlantic_pass_apc_dhw.py

Co-authored-by: Quentame <polletquentin74@me.com>

* Update homeassistant/components/overkiz/water_heater_entities/atlantic_pass_apc_dhw.py

Co-authored-by: Quentame <polletquentin74@me.com>

* Fix small issues

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>
Co-authored-by: Quentame <polletquentin74@me.com>
2022-11-04 10:42:58 +01:00
Renat Sibgatulin dd5baa6e48
Add air-Q integration (air quality sensors) (#76999)
* Added initial files for air-Q integration

* Allow FIXME comments in pylint (temporary)

Also reintroduce --ignore-missing-annotations=y

* Set up air-q entry to connect to aioairq's API (initial attempt)

Also add necessary constants

* Implement a class for sensors and its update logic

Very early stage, WIP

* Zeroconf and authentication are working

* Complete the bare-bone minimal working version

Specifically, make AirQSensor update its values.

* Handle invalid authentication gracefully

* Handle ClientConnectionError gracefully

* Add field hint for the login form

The key in the schema, which defines the form in
`ConfigFlow.async_show_form` is looked up in both `airq/strings/json`
and `airq/translations/en.json`. I am still not 100% sure how this
lookup is performed. WIP

* Minor cleanups

* Extend sensor list to all supported by SensorDeviceClass

Also manage warming up sensors

* aioairq is published to PyPI and mentioned in requirements

* Reordered constants and list content alphabetically

As required by style guides. Also turned SENSOR_TYPES to a list

* Updated file docstrings for a dev unfamiliar w/homeassistant like myself

* Adding a bit of logging for the integration setup process

* Expose scan interval & smoothing flag

Also streamline test_authentication in config_flow.

* Fix a type annotation mistake

* Use as many constants from homeassistant.const as possible

My only concern is using CONST_IP_ADDRESS = "ip_address" for smth which
stands for both IP address and mDNS...

* Temporarily rollback ConfigFlow.async_step_configure and use defaults

TODO: implement OptionFlowHandler instead

* Define custom Coordinator, w subset of airq config

The latter is then accessed from entity / sensor constructors to define
correct DeviceInfo

* Provide translations to de & fr + minor changes to en

* Provide translations to ru + a minor en changes

* Make translation a little more helpful and polite

* Fix devicename and entry title

* Remove stale commented out code

* Test config_flow

At this point two helper functions which interact with the external
library are not tested

* Clean up unrelated and meant as temporary changes

* Clean up unnecessary comments meant for internal use

* Move fetching config to a dedicated async coordinator method

As opposed to it being a potentially poorly justified step in
async_setup_entry

* Remove zeroconf support since it is not yet ready

* Remove translations other than en

* Remove unnecessary comments, manifest.json entries, and constants

* Improve exception handling

- `_LOGGER` uses `debug` and not `error` levels.
- Drop `ClientConnect` and catch `aiohttop.ClientConnectError` directly
- Drop `Exception` as it is not expected from `aioairq` (remove the
  corresponding test too)

* Drop strings for obsolete errors and steps

Specifically, `unknown` error isn't caught any more. `configure` step
has also been removed.

* Refactor en.json to be consistent with strings.json

* Move target_route from a coordinator argument to a constant

At this point a user cannot configure the target_route route, thus it
does not make sense to expose it half-heartedly in
`AirQCoordinator.__init__`, since it cannot be accessed.

* Fix an async call in `AirQCoordinator.async_setup_entry`

* Refactor underlying aioairq API

- Use `homeassistant.helpers.aiohttp.async_get_clientsession` and pass a
  single persistent session to `aioariq.AirQ.__init__`
- `aioairq.AirQ.fetch_device_info` now returns a `DeviceInfo` object heavily
  inspired and almost compatible with `homeassistant.helpers.entity.DeviceInfo`.
  Make heavier use of this object and define a single `DeviceInfo` in the
  `AirQCoordinator` (instead of recreating the same object for each sensor
  of the device in `sensor.AirQSensor`)
- Drop two helper functions in `config_flow.py` and operate on `aioariq.AirQ`
  methods directly

* Fix the version of aioairq

* Add 15 more sensors + icons

* Remove cnt* & TypPS, change units of health & performance

* Add 12 more sensors

* Add a missing icon

* Gracefully handle device not being available on setup

If the device and the host are not on the same WiFi,
ServerTimeoutError is raised, which is caught by
ClientConnectionError.
If the device is powered off, ClientConnectionError is expected.
In both cases, ConfigEntryNotReady is raised, as prescribed by the docs.
Newer version of aioairq times-out far quicker than the default 5 mins.

* Rename two sensors

* Validate provided IP address / mDNS

aioairq now raises InvalidInput if provided IP / mDNS does not seem
valid. Handle this exception correctly

* Apply suggestions from code review

Clean up the comments and rename the logger

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Artem Draft <Drafteed@users.noreply.github.com>

* Only fetch device info during the first refresh

- Fetched info is stored in AirQCoordinator.device_info.
- In `AirQSensor.native_value` only multiply by the factor if
  the sensor reading is not None
- Fix the tests for ConfigFlow for aioairq==0.2.3. Specifically
  make the dummy data pass the new validation step upstream
  + add a test which fails it

* Drop custom device classes for now

* Apply suggestions from code review

Co-authored-by: Artem Draft <Drafteed@users.noreply.github.com>

* Only fetch device info during ConfigFlow.async_step_user

Store the result obtained by `airq.fetch_device_info` it in
`config_entry.data`. Pass the entire config entry to `AirQCoordinator`
and build the entire `homeassistant.helpers.entity.DeviceInfo` in the
`AirQCoordinator.__init__`. This makes
`AirQCoordinator._async_fetch_device_info` and overloaded
`AirQCoordinator._async_config_entry_first_refresh` obsolete.

Bump aioairq version.

Turn update_interval from `AirQCoordinator.__init__` argument into a
contestant.

* Custom entity description exposing a hook to modify sensor value

Use a `AirQEntityDescription` with a callable `value_fn` which allows to
change the sensor value retrieved from the device. Note that the
callable does not handle data retrieval itself (even from
`coordinator.data`). Instead it is purely a hook to transform obtained
value.

* Avoid duplicated use of unique_id

Device info is fetched  during the `ConfigFlow.async_user_step`.
`unique_id` is taken from the device info and is **not** stored
in `config_entry.data`. Subsequently `config_entry.unique_id` is
used instead.

* Drop unnecessary try-except

Co-authored-by: Artem Draft <Drafteed@users.noreply.github.com>

* Clarify the use of value_transform_fn

* Refactor the use of lambdas in AirQEntityDescription

Now it is the job of the callable under `value` to get the sensor
reading from the coordinator's data. Factoring this functionality into a
callback decouples  the key of the description from the key of dict,
returned by the API, so `AirQEntityDescription` no longer requires its key
to be set to smth clearly internal (e.g. `nh3_MR100`).

* Use a callback to update native_value

Since all `native_value`s are updated synchronously, it can as well be
done in a callback for better state consistency (right?)

* Revert the description keys to match data keys

Must match given the current way of identifying available sensors. On a
broader scale, they must match to be able to relate the descriptions to
sensors, unless a separate lookup table is maintained.

* Reduce number of loops when adding sensors

Filtering warming up sensors and non-sensor keys can be combined with
adding entities.

* Remove obsolete imports

* Update integrations.json

* Add integration_type

Integration supports multiple devices => hub

Co-authored-by: dl2080 <daniel.lehmann@runbox.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Artem Draft <Drafteed@users.noreply.github.com>
Co-authored-by: Daniel Lehmann <43613560+dl2080@users.noreply.github.com>
Co-authored-by: Martin Selbmann <job@martin-selbmann.de>
2022-11-03 23:13:57 +01:00
Rami Mosleh 328eda044a
Use DataUpdateCoordinator for glances (#72748)
* use DataUpdateCoordinator for glances

add tests to increase coverage

fix test_config_flow.py

fix codecov/patch

remove unused const, minor tweaks

remove invalid_auth test as it is not implemented

fix type hints

* change to async_forward_entry_setups

* Use Dataupdatecoordinator for glances

* minor fixex

* minor fixes

* minor fix

* remove support_versions const

* coe cleanup

* address comments

* fix sensor native_value

* Rename entry to entry_data in `get_api`

* Remove whitespace in sensor name
2022-11-03 10:02:25 +01:00
Rami Mosleh fc3843f5e2
Add config flow to `pushbullet` (#74240)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-11-02 16:11:44 +01:00
Daniel Gangl b2b3c47917
Add config flow to zamg (#66469) 2022-10-26 18:35:12 +02:00
Øyvind Matheson Wergeland 712b984833
Support Nobø Switch as temperature sensor (#78480)
* Expose Nobø Switch as temperatur sensor.

* - Review
- Hub may report current temperature as None

* Avoid update during entity addition, and fix race condition

* Update pynobo to 1.6.0
Use new method to fix potential race condition.

* Use generator expressions
2022-10-24 01:55:22 +02:00
Shay Levy 228d491216
Fix Shelly entry unload and add tests for init (#80760) 2022-10-22 09:00:35 +02:00
Willem-Jan van Rootselaar 1fe397f7d7
Update bsblan integration (#67399)
* Update bsblan integration

Update the integration to current standards

* removed unused code

update coverage

* some cleanup

* fix conflicts due upstream changes

* fix prettier json files

* fix remove comment code

* use dataclass instead of tuple

* fix spelling

* Set as class attribute

main entity doesn't need to give own name

* fix requirements
2022-10-18 12:06:51 +02:00
kingy444 5ead3b2605
Powerview Add Battery Option Selection (#80166)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-10-17 11:30:33 -05:00
Jeef ff2d762f55
Intellifire - Number Entity - Flame Height Control (#79901)
* Adding flame height control

* oops

* addressing comments

* fix coverage file

* addressing PR comments
2022-10-15 12:43:47 -06:00