Commit Graph

813 Commits (23831d746ea322e0d23abca705478963ed741146)

Author SHA1 Message Date
Erik Montnemery e1338adf1a
Allow configuring country and language in core config (#81734)
* Allow configuring country and language in core config

* Add script for updating list of countries

* Use black for formatting

* Fix quoting

* Move country codes to a separate file

* Address review comments

* Add generated/countries.py

* Get default language from owner account

* Remove unused variable

* Add script to generate list of supported languages

* Add tests

* Fix stale docsring

* Use format_python_namespace

* Correct async_user_store

* Improve typing

* Fix with_store decorator

* Initialize language in core store migration

* Fix startup

* Tweak

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Update storage.py

Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-11-24 23:25:50 +01:00
Franck Nijhof 285aff154d
Remove Google Chat/Hangouts integration (#82645) 2022-11-24 18:33:13 +01:00
Álvaro Fernández Rojas f1ffb25d99
Add Airzone DHCP discovery support (#82339) 2022-11-23 12:32:23 -07:00
Tom Schneider 27e6b69656
Add yamaha brand configuration (#81267)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-11-23 20:19:20 +01:00
G Johansson b3dd59f202
Add config flow to Scrape (#81193)
* Scrape take 2

* cleanup

* new entity name

* Fix name, add tests

* Use FlowResultType

* Add test abort

* hassfest

* Remove not needed test

* clean

* Remove config entry and implement datacoordinator

* fix codeowners

* fix codeowners

* codeowners reset

* Fix coordinator

* Remove test config_flow

* Fix tests

* hassfest

* reset config flow

* reset strings

* reset sensor

* Reconfig

* Fix tests

* coverage

* Remove coverage

* Remove print

* Add config flow

* Fix config flow

* Add back init

* Add entry to sensor

* float to int

* Fix SelectSelector

* Add tests for config entry to existing

* Test config flow

* Fix test reload

* Fix rebase

* Fix strings

* clean init

* Clean test_sensor

* Align sensor setup entry

* Add error to strings

* review changes

* clean tests

* Add back options flow

* review changes

* update_listener

* Add tests

* Remove duplicate abort

* strings

* sensors to sensor

* review changes

* more review changes

* clarify test payload

* fixture name
2022-11-21 21:39:39 +01:00
Aarni Koskela 38b84620bd
Add support for Sensirion BLE sensors (#82382) 2022-11-19 14:26:54 -06:00
J. Nick Koston 4c8850ec7b
Add dhcp support for newer powerwall gateways (#82236) 2022-11-17 10:10:55 +01:00
Brynley McDonald 3bfb91d159
Add integration_type for flick_electric (#81065)
* Add integration_type for flick_electric

* Updates from hassfest
2022-11-16 00:27:09 -06:00
J. Nick Koston f035223599
Make sure the config_flow key is set for brands (#82038)
Fixes https://github.com/home-assistant/frontend/issues/14376
2022-11-15 18:27:59 +01:00
Ernst Klamer af73afa2e2
Add support for HHCCJCY10 to xiaomi_ble (#82069) 2022-11-14 11:18:51 -06:00
J. Nick Koston 50f960097f
Add support for thermobeacon WS 03 aka device 0x18 (#82045)
* Add support for thermobeacon WS 03 aka device 0x18

changelog: https://github.com/Bluetooth-Devices/thermobeacon-ble/compare/v0.3.2...v0.4.0

* empty
2022-11-13 20:30:50 +01:00
Malte Franken 3658c5f673
Add integration_type to nsw_rural_fire_service_feed (#82031)
define integration type
2022-11-13 16:06:33 +01:00
Malte Franken 3089ca06c5
Add integration_type to qld_bushfire (#81895)
define integration type
2022-11-10 08:16:37 +01:00
Aarni Koskela f3e85b6492
Deduplicate blackening (#81802) 2022-11-09 16:58:20 +01:00
Aarni Koskela ec316e94ed
RuuviTag BLE sensor support (#81327) 2022-11-09 08:35:30 -06:00
Ernst Klamer b72876d369
Add support for BTHome V2 to bthome (#81811)
* Add BTHome v2 support

* Add new sensor types

* Add new sensor types
2022-11-09 15:31:58 +01:00
Malte Franken b7f3eb77dc
Add integration_type to usgs_earthquakes_feed (#81846) 2022-11-09 11:20:27 +01:00
Malte Franken 3edaef63b0
Add integration_type to ign_sismologia (#81729)
define integration type
2022-11-08 14:47:00 +01:00
Erik Montnemery c3d4a9cd99
Create repairs issue if an outdated currency code is configured (#81717)
* Create repairs issue if an outdated currency code is configured

* Add script for updating list of currencies

* Use black for formatting

* Move currency codes to a separate file

* Address review comments
2022-11-08 07:21:09 +01:00
Robert Hillis bc146a09db
Add integration_type for some integrations (#81499) 2022-11-07 19:39:29 +01:00
puddly 604cd46ec9
Enable SkyConnect config flow and use correct case in USB matching (#81522)
* Ensure `USBCallbackMatcher` uses the appropriate case for each field

* Enable the config flow for the SkyConnect integration

* Update unit test
2022-11-07 17:26:16 +01:00
Mick Vleeshouwer ff18cece7b
Add Brandt, Hexaom, SIMU & Ubiwizz as virtuals integrations of Overkiz (#79566)
* Match supported brands with Overkiz libs

* Add missing files for mypy
2022-11-07 16:17:56 +01:00
StefanIacobLivisi 902e075d58
Add livisi integration (#76863) 2022-11-07 14:40:23 +01:00
Malte Franken efd60de1ac
Add integration_type to geonetnz_volcano (#81607)
define integration type
2022-11-07 09:01:07 +01:00
Malte Franken 64a508be7b
Add integration_type to geonetnz_quakes (#81548)
define integration type
2022-11-05 11:05:19 +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
Malte Franken ee4d28000d
Add integration_type to gdacs (#81451) 2022-11-03 09:32:40 +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
Aidan Timson d6689937a3
Add integration type to OVO Energy (#81187) 2022-10-31 20:42:02 +01:00
Aidan Timson 8044b9587a
Add integration type to System Bridge (#81186) 2022-10-31 20:41:12 +01:00
aschmitz a766b41b13
Add basic Aranet integration (#80865) 2022-10-30 22:50:46 -05:00
G Johansson 7bd89621ce
Change IoT Class for Min/Max to calculated (#81199) 2022-10-29 14:21:28 -04:00
epenet 7feb463a4c
Add integration_type to samsungtv (#81101) 2022-10-27 19:18:09 +03:00
Steven Looman d50795af2b
Move upnp derived sensors to library, be more robust about failing getting some data (#79955) 2022-10-26 14:34:44 -05:00
Daniel Gangl b2b3c47917
Add config flow to zamg (#66469) 2022-10-26 18:35:12 +02:00
Marc Mueller b148cdd64a
Add integration type to fritzbox_callmointor integration (#81032) 2022-10-26 18:19:54 +02:00
Raman Gupta 1b3c383558
Add integration_type to vizio, tomorrowio, zwave_js (#80975) 2022-10-25 23:31:44 +02:00
Aaron Bach 2af58ad609
Set integration type on codeowned integrations @bachya (#80974) 2022-10-25 22:23:54 +02:00
Franck Nijhof 98591cd4b6
Remove hardware and fix raspberry pi brands in integrations.json (#80970) 2022-10-25 21:05:04 +02:00
Erik Montnemery 3aa64aaaf1
Mark some integrations as system integrations (#80948) 2022-10-25 15:30:46 +02:00
Bram Kragten 36bb0bbc1a
Fix `integrations.json` creation, make `iot_standards` a list (#80945) 2022-10-25 13:43:40 +02:00
hackerESQ f977b264a1
Add tplink dhcp entry for EP25 model (#80650)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-10-25 13:22:09 +02:00
Franck Nijhof 52f109f6ab
Add IKEA SYMFONISK as virtual integration (#80833) 2022-10-25 12:09:22 +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
Simon Hansen b56d332c26
Add integration_type to launchlibrary (#80907) 2022-10-24 23:23:14 +02:00
Simon Hansen 2ddf1f9416
Add integration_type to iss (#80909) 2022-10-24 23:19:59 +02:00
Kevin Addeman fdcce0446c
Add Lutron Caseta zeroconf discovery for RA3/HWQSX (#80852) 2022-10-23 18:17:36 -05:00
Franck Nijhof d4a5393f7b
Set integration type on codeowned integrations @frenck (#80830) 2022-10-23 20:43:13 +02:00
Chris Talkington 9734086d9b
Add integration_type to jellyfin (#80832) 2022-10-23 13:42:25 -05:00
Chris Talkington 18f51db15d
Add integration_type to ipp and roku (#80831) 2022-10-23 13:31:24 -05:00