Commit Graph

1097 Commits

Author SHA1 Message Date
starkillerOG c4a5d12df4
Switch to reolink-aio (#85014)
* switch to reolink-aio

* fix imports
2023-01-02 20:49:55 -05: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
Lukas Barth 50f05ac51a
Remove myself as a code owner (#84701)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-12-29 09:14:48 +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
PierreAronnax 7ef145d4ce
Return unavailable if Govee BLE sensor is in error (#84547)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-12-27 10:11:41 -10: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
Allen Porter b8ce10f9a1
Add myself as a codeowner for rainbird (#84421) 2022-12-21 21:45:47 -08:00
Franck Nijhof 80b3572627
Rename image integration to image_upload (#84063)
* Rename image integration to image_upload

* fix test
2022-12-16 08:16:38 -05: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
tronikos 5d31673465
Google Assistant SDK integration (#82328)
* Copy google_sheets to google_assistant_sdk

This is to improve diff of the next commit with the actual implementation.

Commands used:
cp -r homeassistant/components/google_sheets/ homeassistant/components/google_assistant_sdk/
cp -r tests/components/google_sheets/ tests/components/google_assistant_sdk/

find homeassistant/components/google_assistant_sdk/ tests/components/google_assistant_sdk/ -type f | xargs sed -i \
-e 's@google_sheets@google_assistant_sdk@g' \
-e 's@Google Sheets@Google Assistant SDK@g' \
-e 's@tkdrob@tronikos@g'

* Google Assistant SDK integration
Allows sending commands and broadcast messages to Google Assistant.

* Remove unnecessary async_entry_has_scopes check

* Bump gassist-text to fix protobuf dependency
2022-12-09 07:14:43 -08:00
Martin Hjelmare 694cec3459
Set matter team as matter codeowners (#83506) 2022-12-07 23:53:30 +01:00
Nyro 7af18ac0ad
Add @nyroDev to overkiz codeowner (#83456)
* Add @nyroDev to overkiz codeowner

* Update manifest.json too
2022-12-07 13:26:36 +01:00
Sean Chen c8fbdde3b8
Add @kamiyo to nws codeowners (#83171) 2022-12-05 10:59:25 +01: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
Allen Porter 532ab12a48
Local calendar integration (#79601) 2022-11-30 21:20:21 +01:00
Jan Bouwhuis 89a7d5fecc
Update codeowners for mqtt integration (#82979)
Add @jbouwh to codeowners
2022-11-30 14:55:31 +01:00
north3221 d8a7336a3f
Remove as codeowner for tado (#82919) 2022-11-29 13:58:53 +01:00
Jan Bouwhuis fcccc44ccb
Cleanup unused AlexaPercentageController code (#82880) 2022-11-29 10:06:53 +01:00
G Johansson cf681cd921
Add myself as codeowner for min_max (#82658)
codeowner
2022-11-24 20:14:08 +01:00
Raman Gupta 003e4224c8
Add `text` platform (#79454)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-11-24 20:01:01 +01:00
Aarni Koskela 38b84620bd
Add support for Sensirion BLE sensors (#82382) 2022-11-19 14:26:54 -06:00
Erik Montnemery aaec464627
Add support for managing the silabs multiprotocol add-on (#82170)
* Add support for managing the silabs multiprotocol add-on

* Fix passing context when starting option flow

* Allow unloading a ha yellow config entry

* Fix tests

* Log data passed to ZHA option flow

* Improve ZHA migration logic

* Move tests

* Improve test coverage

* Remove dead code

* Drop automatic ZHA migration
2022-11-16 17:38:07 +01:00
J. Nick Koston 435fc23737
Add shelly ble scanner support (#82007) 2022-11-15 12:34:45 -06:00
cdheiser 2813101418
Add cdheiser to Lutron codeowners (#81922)
* Update manifest.json

Add cdheiser as codeowner

* Update CODEOWNERS

Add @cdheiser as owner of Lutron.
2022-11-10 19:35:47 +01:00
Aarni Koskela ec316e94ed
RuuviTag BLE sensor support (#81327) 2022-11-09 08:35:30 -06:00
Jon Gilmore 0ce301ae7b
Remove JonGilmore from lutron codeowners (#81727) 2022-11-07 21:22:03 -06:00
StefanIacobLivisi 902e075d58
Add livisi integration (#76863) 2022-11-07 14:40:23 +01:00
tstabrawa 499839c596
Fix nuheat temporary hold time (#81635)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-11-06 19:16:22 -06: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 fc3843f5e2
Add config flow to `pushbullet` (#74240)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-11-02 16:11:44 +01:00
aschmitz a766b41b13
Add basic Aranet integration (#80865) 2022-10-30 22:50:46 -05:00
Daniel Gangl b2b3c47917
Add config flow to zamg (#66469) 2022-10-26 18:35:12 +02:00
mtdcr 93d4d02aac
Remove myself from edl21 codeowners (#80947) 2022-10-25 14:38:42 +02:00
J. Nick Koston 559e281431
Add oralb integration (#80918)
* mapping

* update

* working

* tests

* fixes

* temp add binary sensor platform to make sure it works

* fixes

* 100% cover

* adjust

* disable chatty sensors by default

* remove binary sensor_platform for next PR

* time is much nicer than counter
2022-10-24 23:11:40 -05:00
PeteRager 59b2869f6a
Fix oncue data unavailable when genset disconnected (#80668)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-10-23 18:01:43 -05:00
epenet 10dbef80ae
Add myself as code owner to util and const (#80664) 2022-10-22 15:07:43 +02:00
Maciej Bieniek 9fa5c5c576
Remove myself from Xiaomi Miio code owner list (#80768) 2022-10-22 12:36:52 +02:00
Paulus Schoutsen a20ac2b246
Remove balloob as code owner Ring (#80680) 2022-10-20 12:09:16 -04:00
epenet ddba653158
Add new codeowners to scrape (#80569) 2022-10-18 19:29:11 -06:00
Franck Nijhof 83557ef762
Add myself as codeowner to Alert (#80169) 2022-10-12 14:51:09 +02:00
Austin Brunkhorst 7d097d18b0
Add support for Snooz BLE devices (#78790)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-10-10 13:14:27 -10:00
Steven Looman ac44c8e34d
Update codeowners for upnp component (#80042)
Drop @ehendrix23 from codeowners
2022-10-10 23:15:58 +03:00
Chris Talkington 5b0a37a447
Use persistent device id for jellyfin requests (#79840) 2022-10-08 21:12:30 -05:00
Aaron Bach e45701fe89
Add @bachya as a LaMetric codeowner (#79772) 2022-10-07 15:33:53 +02:00
Matthew Simpson df7b8f419e
Bump btsmarthub_devicelist to 0.2.3 (#79705)
* Bump btsmarthub_devicelist

This PR bumps the btsmarthub_devicelist version to correct an issue
experienced by a recent firmware upgrade to the SmartHub2.

* Bump btsmarthub_devicelist to 0.2.3

This version bump fixes an issue where BT SmartHub2 devices cannot be
correctly autodetected. The current workaround is to specifiy it
manually, which isn't great UX (and did previously work until a recent
firmware upgrade).

I've also taken the opportunity to reassign ownership of the component
to myself as @jxwolstenholme no longer has a SmartHub so cannot do
manual testing and also has no need to use the component anymore.
2022-10-06 17:01:27 +02:00
Vincent Giorgi d5b966d942
Add Airthings BLE component (#77284)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-09-29 15:55:45 -04:00
Yuxin Wang 52307708c8
Refactor apcupsd to use config flow (#64809)
* Add Config Flow to APCUPSd integration and remove YAML support.

* Hide the binary sensor if user does not select STATFLAG resource.

* Add tests for config flows.

* Simplify config flow code.

* Spell fix.

* Fix pylint warnings.

* Simplify the code for config flow.

* First attempt to implement import flows to suppport legacy YAML configurations.

* Remove unnecessary log calls.

* Wrap synchronous update call with `hass.async_add_executor_job`.

* Import the YAML configurations when sensor platform is set up.

* Move the logger call since the variables are not properly set up.

* Add codeowner.

* Fix name field of manifest.json.

* Fix linting issue.

* Fix incorrect dependency due to incorrect rebase.

* Update codeowner and config flows via hassfest.

* Postpone the deprecation warning to 2022.7.

* Import future annotations for init file.

* Add an newline at the end to make prettier happy.

* Update github id.

* Add type hints for return types of steps in config flow.

* Move the deprecation date for YAML config to 2022.12.

* Update according to reviews.

* Use async_forward_entry_setups.

* Add helper properties to `APCUPSdData` class.

* Add device_info for binary sensor.

* Simplify config flow.

* Remove options flow strings.

* update the tests according to the changes.

* Add `entity_registry_enabled_default` to entities and use imported CONF_RESOURCES to disable entities instead of skipping them.

* Update according to reviews.

* Do not use model of the UPS as the title for the integration.

Instead, simply use "APCUPSd" as the integration title and let the device info serve as title for each device instead.

* Change schema to be a global variable.

* Add more comments.

* Rewrite the tests for config flows.

* Fix enabled_by_default.

* Show friendly titles in the integration.

* Add import check in `async_setup_platform` to avoid importing in sensor platform setup.

* Add import check in `async_setup_platform` to avoid importing in sensor platform setup.

* Update comments in test files.

* Use parametrize instead of manually iterating different test cases.

* Swap the order of the platform constants.

* Avoid using broad exceptions.

* Set up device info via `_attr_device_info`.

* Remove unrelated test in `test_config_flow`.

* Use `DeviceInfo` instead of dict to assign to `_attr_device_info`.

* Add english translation.

* Add `async_create_issue` for deprecated YAML configuration.

* Enable UPS status by default since it could show "online, charging, on battery etc" which is meaningful for all users.

* Apply suggestions from code review

* Apply suggestion

* Apply suggestion

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-09-28 09:14:04 +02:00
Tom Puttemans 7aa53feff4
Add config flow and MQTT autodiscover to dsmr_reader integration (#71617)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-09-25 23:15:50 -04:00