Commit Graph

1635 Commits (946df49ca89fe4d7e342c6aff426a070c8b7adcc)

Author SHA1 Message Date
J. Nick Koston 20c35e6032
Move Screenlogic lights to the light platform (#55467)
Co-authored-by: Kevin Worrel <37058192+dieselrabbit@users.noreply.github.com>
2021-10-20 12:38:21 -10:00
jan iversen f2a5d92e61
Fix connect_fail test and modbus.py 100% coverage (#57894)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-10-20 15:22:24 -07:00
jan iversen 45983b5edf
Activate tradfri in coverage and clean conftest for tradfri (#58058) 2021-10-20 13:36:02 +02:00
Franck Nijhof fbe3ce1bf7
Add cover platform to Tuya (#58045) 2021-10-19 19:36:15 +02:00
Franck Nijhof d8a354fa8f
Add humidifier platform to Tuya (#58025) 2021-10-19 12:10:05 +02:00
Daniel Hjelseth Høyer a3cae17d88
Open garage sensor (#57976) 2021-10-19 09:05:55 +02:00
Robert Hillis 4625a05706
Add init tests for agent dvr (#57022)
* Add init tests for agent dvr

* ci
2021-10-19 08:53:30 +02:00
Franck Nijhof 174eaefe61
Add vacuum platform to Tuya (#57996) 2021-10-18 23:30:26 +02:00
Franck Nijhof d64f210b67
Add camera platform to Tuya (#57865) 2021-10-16 14:57:30 -07:00
Franck Nijhof 6e5d49144a
Add siren platform to Tuya (#57780) 2021-10-15 22:28:14 +02:00
Martin Hjelmare 31ccaac865
Add vlc telnet config flow (#57513) 2021-10-15 11:46:58 -07:00
Franck Nijhof 0407a56fdf
Add number platform to Tuya (#57672) 2021-10-14 13:15:41 -07:00
Franck Nijhof cef34356e2
Add sensor platform to Tuya (#57668) 2021-10-14 12:04:02 -07:00
Franck Nijhof fdc6d9e004
Add select platform to Tuya (#57674) 2021-10-14 09:50:51 -07:00
Franck Nijhof b28062789f
Remove deprecated Lyft integration (#57638) 2021-10-14 11:27:09 +02:00
ollo69 827501659c
Nut: Use coordinator data, code cleanup and add test coverage (#57643) 2021-10-13 16:05:06 -10:00
Franck Nijhof 45f3eb6991
Remove deprecated Wink integration (#57634) 2021-10-14 00:20:13 +02:00
Franck Nijhof b2cef78d90
Add binary sensor platform to Tuya (#57623) 2021-10-13 22:12:07 +02:00
jan iversen 2734ae17f3
Modbus baseplatform.py and Validators.py 100% coverage (activate coverage) (#57546) 2021-10-13 11:51:51 -07:00
RenierM26 48c2cfa6f8
Use entity description for Ezviz sensors (#56634) 2021-10-11 20:09:19 +02:00
Glenn Waters d0b37229dd
Switch to config_flow for Environment Canada (#57127)
* Add config_flow to Environment Canada

* Add unique_id

* Remove erroneous directory.

* Tests working!!

* Add back setup.

* First cut of import.

* Temp

* Tweak names.

* Import config.yaml.

* Clean up imports.

* Import working! Some refactor to clean it up.

* Add import test.

* Small optimization.

* Fix comments from code review.

* Remove CONF_NAME and config_flow for it.

* Fixup strings to match new config_flow.

* Fixes for comments from last review.

* Update tests to match new import code.

* Clean up use of CONF_TITLE; fix lint error on push.

* Phew. More cleanup on import. Really streamlined now!

* Update tests.

* Fix lint error.

* Fix lint error, try 2.

* Revert unique_id to use location as part of ID.

* Fix code review comments.

* Fix review comments.
2021-10-11 17:33:29 +02:00
Marc Mueller 858739949b
Use EntityDescription - openweathermap (#56888) 2021-10-11 16:18:18 +02:00
jan iversen 199cf649be
Add test of lazy_error in modbus (#57170) 2021-10-11 12:43:05 +02:00
Franck Nijhof 82160fa350
Add config flow to Stookalert (#57119) 2021-10-08 11:34:22 +02:00
Kevin Hellemun dc5e4392ae
Refactor Xiaomi vacuum to sensors (#54990)
* Refactor Xiaomi vacuum with sensors.

This is the first step into refactoring xiaomi vacuum attributes into sensors.
What is missing are some switches and binary sensors etc.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Use generic sensor for Xiaomi vacuum sensors.

By using HA coordinator, the generic Xiaomi sensor class can be used with these
coordinators to get the status sensors from vacuum. This also means now that
sensors are available as soon as HA starts, which is a nice plus.

Now the only reason to create a subclass of the generic sensors is when custom
value parsing needs to be done.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Working vacuum sensors via 1 coordinator.

Vacuum needs a custom coordinator to ensure that it fetches all the needed data
and puts it in a dict. From this dict the sensors will then get their data
accordingly.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Remove vacuum setup method in sensor

Sensor is generic enough that vacuum does not require its own setup method.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Don't auto register generic sensors.

Let the user decide which sensor is useful for them and enable them.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Remove converted attributes from xiaomi vacuum.

The attributes that have been converted so far should be removed from the vacuum
attributes list.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Fetch data from vacuum sequentially.

It seems some vacuums do not like parallel requests. The requests that came
before are ignored.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Refactor vacuum sensors to its own container.

By moving vacuum sensors to its own container, there is no more key collisions.
This in turns means that there is need for the split hack to ensure key names
are correct.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* fixup! fix bad rebase.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Fix sensor naming and default registration.

Use proper names for sensors, no need to include from which device status it
came.

Registration of the sensor by default has been parameterised. If the param is
not set, the sensor is not registered.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Make vacuum platform also use coordinator for its data.

By using the coordinator for data in vacuum platfrom, removes the cases where
request gets ignored during the case where the requests are done concurrently by
separate platforms.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Add binary sensor for vacuum

Add binary sensor for waterbox, mop, and water shortage.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Added proper icons to sensors.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Refactor sensors to use dataclass.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Make vacuum use coordinator for its data.

This commit also insures that the binary sensors are only registered for devices
that include a mop.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Apply suggestions from code review

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

* Minor refactoring

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Update data from coordinator after running command.

This is is to have a faster status change when executing a command like changing
fan speeds. If a manual refresh is not triggered. Worst case scenario it will
take 10s for the new fan speed to be reported in HA.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Refresh within coroutine is ok.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Move logging to _handle_coordinator_update

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Use internal state attribute.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Fix vacuum typing

* Fix tests constants

* Fix vacuum inconsistent return values

* Fix vacuum state update

* Fix vacuum tests

* Remove impossible cases

* Parametrize custom services test

* Move goto test

* Move clean segment test

* Move clean single segment test

* Test service pause

* Include vacuum in coverage

* Delint

* Fix vacuum sensor dict collision.

This also prevents collision for unique id. As the key is used to construct
unique ids.

* Use f strings as dict keys

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 18:30:17 +02:00
Sylvia van Os dc6f6b7f68
Remove Essent integration (#56991) 2021-10-04 13:31:40 +02:00
icemanch a95c6b10f7
Flux led config flow (#56354)
Co-authored-by: Milan Meulemans <milan.meulemans@live.be>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-10-02 07:19:36 -10:00
Oliver Ou d3b1ccb668
Tuya v2 Integration Release (#56820)
Co-authored-by: 乾启 <18442047+tsutsuku@users.noreply.github.com>
Co-authored-by: dengweijun <dengweijunben@gmail.com>
Co-authored-by: dengweijun <mengzi.deng@tuya.com>
Co-authored-by: erchuan <jie.zheng@tuya.com>
Co-authored-by: erchuan <erchuan365@outlook.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-09-30 12:02:56 +02:00
Maciej Bieniek 0463007050
Add switch platform to Tractive integration (#55517) 2021-09-29 21:06:11 +02:00
Daniel Hjelseth Høyer d5c3d234ec
Open garage, add config flow (#55290) 2021-09-29 09:43:51 -06:00
Maciej Bieniek 2581a3a735
Add binary sensor platform to Tractive integration (#56635)
* Add binary sensor platform

* Update .coveragerc file

* Create battery charging sensor only if tracker supports it

* Improve async_setup_entry

* Add TRAXL1 model
2021-09-28 09:56:06 +02:00
Myles Eftos 412ecacca3
Amberelectric (#56448)
* Add Amber Electric integration

* Linting

* Fixing some type hinting

* Adding docstrings

* Removing files that shouldn't have been changed

* Splitting out test helpers

* Testing the price sensor

* Testing Controlled load and feed in channels

* Refactoring mocks

* switching state for native_value and unit_of_measurement for native_unit_of_measurement

* Fixing docstrings

* Fixing requiremennts_all.txt

* isort fixes

* Fixing pylint errors

* Omitting __init__.py from test coverage

* Add missing config_flow tests

* Adding more sensor tests

* Applying suggested changes to __init.py__

* Refactor coordinator to return the data object with all of the relevent data already setup

* Another coordinator refactor - Better use the dictionary for when we build the sensors

* Removing first function

* Refactoring sensor files to use entity descriptions, remove factory

* Rounding renewable percentage, return icons correctly

* Cleaning up translation strings

* Fixing relative path, removing TODO

* Coordintator tests now accept new (more accurate) fixtures

* Using a description placeholder

* Putting missing translations strings back in

* tighten up the no site error logic - self._site_id should never be None at the point of loading async_step_site

* Removing DEVICE_CLASS, replacing the units with AUD/kWh

* Settings _attr_unique_id

* Removing icon function (it's already the default)

* Apply suggestions from code review

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

* Adding strings.json

* Tighter wrapping for try/except

* Generating translations

* Removing update_method - not needed as it's being overriden

* Apply suggestions from code review

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

* Fixing tests

* Add missing description placeholder

* Fix warning

* changing name from update to update_data to match async_update_data

* renaming [async_]update_data => [async_]update_price_data to avoid confusion

* Creating too man renewable sensors

* Override update method

* Coordinator tests use _async_update_data

* Using $/kWh as the units

* Using isinstance instead of __class__ test. Removing a zero len check

* Asserting self._sites in second step

* Linting

* Remove useless tests

Co-authored-by: jan iversen <jancasacondor@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-09-28 00:03:51 -07:00
Michael Chisholm a28fd7d61b
Config-flow for DLNA-DMR integration (#55267)
* Modernize dlna_dmr component: configflow, test, types

* Support config-flow with ssdp discovery
* Add unit tests
* Enforce strict typing
* Gracefully handle network devices (dis)appearing

* Fix Aiohttp mock response headers type to match actual response class

* Fixes from code review

* Fixes from code review

* Import device config in flow if unavailable at hass start

* Support SSDP advertisements

* Ignore bad BOOTID, fix ssdp:byebye handling

* Only listen for events on interface connected to device

* Release all listeners when entities are removed

* Warn about deprecated dlna_dmr configuration

* Use sublogger for dlna_dmr.config_flow for easier filtering

* Tests for dlna_dmr.data module

* Rewrite DMR tests for HA style

* Fix DMR strings: "Digital Media *Renderer*"

* Update DMR entity state and device info when changed

* Replace deprecated async_upnp_client State with TransportState

* supported_features are dynamic, based on current device state

* Cleanup fully when subscription fails

* Log warnings when device connection fails unexpectedly

* Set PARALLEL_UPDATES to unlimited

* Fix spelling

* Fixes from code review

* Simplify has & can checks to just can, which includes has

* Treat transitioning state as playing (not idle) to reduce UI jerking

* Test if device is usable

* Handle ssdp:update messages properly

* Fix _remove_ssdp_callbacks being shared by all DlnaDmrEntity instances

* Fix tests for transitioning state

* Mock DmrDevice.is_profile_device (added to support embedded devices)

* Use ST & NT SSDP headers to find DMR devices, not deviceType

The deviceType is extracted from the device's description XML, and will not
be what we want when dealing with embedded devices.

* Use UDN from SSDP headers, not device description, as unique_id

The SSDP headers have the UDN of the embedded device that we're interested
in, whereas the device description (`ATTR_UPNP_UDN`) field will always be
for the root device.

* Fix DMR string English localization

* Test config flow with UDN from SSDP headers

* Bump async-upnp-client==0.22.1, fix flake8 error

* fix test for remapping

* DMR HA Device connections based on root and embedded UDN

* DmrDevice's UpnpDevice is now named profile_device

* Use device type from SSDP headers, not device description

* Mark dlna_dmr constants as Final

* Use embedded device UDN and type for unique ID when connected via URL

* More informative connection error messages

* Also match SSDP messages on NT headers

The NT header is to ssdp:alive messages what ST is to M-SEARCH responses.

* Bump async-upnp-client==0.22.2

* fix merge

* Bump async-upnp-client==0.22.3

Co-authored-by: Steven Looman <steven.looman@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-27 15:47:01 -05:00
Teemu R b40d229369
Rework TPLink integration to use python-kasa (#56701)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-27 14:11:55 -05:00
RenierM26 915afedcfc
Add binary_sensor to switchbot (#56415)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-23 17:10:34 -05:00
Milan Meulemans 0b53f73fe2
Convert Nanoleaf integration to use Async library aionanoleaf (#56548) 2021-09-23 15:37:37 -05:00
RenierM26 972db29c88
Add sensor to switchbot platform (#56416)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-23 15:27:34 -05:00
Daniel Hjelseth Høyer 6e7bc65e2e
Airthings (#56578) 2021-09-23 13:20:30 -07:00
Daniel Hjelseth Høyer a94514b00d
Add Surepetcare entity class (#56430) 2021-09-23 13:19:46 -07:00
RenierM26 26e9590927
Add cover platform to switchbot (#56414)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-21 12:35:47 -05:00
Aaron Bach aabc8cd2d5
Add WattTime integration (#56149) 2021-09-20 21:10:24 -07:00
Milan Meulemans d76163e5be
Add tests for Rituals Perfume Genie number, select and binary_sensor platforms (#55224) 2021-09-19 08:51:57 -10:00
RenierM26 3ce8109e5e
Add config flow to Switchbot (#50653)
Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-18 09:25:05 -10:00
Shulyaka ddfe94187e
generic_hygrostat: enable tests (#56193) 2021-09-15 07:55:43 +02:00
Ricardo Steijn 2a51bb5bba
Add Crownstone integration (#50677) 2021-09-14 09:46:52 -10:00
starkillerOG 5f86388f1c
Netgear config flow (#54479)
* Original work from Quentame

* Small adjustments

* Add properties and method_version

* fix unknown name

* add consider_home functionality

* fix typo

* fix key

* swao setup order

* use formatted mac

* add tracked_list option

* add options flow

* add config flow

* add config flow

* clean up registries

* only remove if no other integration has that device

* tracked_list formatting

* convert tracked list

* add import

* move imports

* use new tracked list on update

* use update_device instead of remove

* add strings

* initialize already known devices

* Update router.py

* Update router.py

* Update router.py

* small fixes

* styling

* fix typing

* fix spelling

* Update router.py

* get model of router

* add router device info

* fix api

* add listeners

* update router device info

* remove method version option

* Update __init__.py

* fix styling

* ignore typing

* remove typing

* fix mypy config

* Update mypy.ini

* add options flow tests

* Update .coveragerc

* fix styling

* Update homeassistant/components/netgear/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add ConfigEntryNotReady

* Update router.py

* use entry.async_on_unload

* Update homeassistant/components/netgear/device_tracker.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* use cv.ensure_list_csv

* add hostname property

* Update device_tracker.py

* fix typo

* fix isort

* add myself to codeowners

* clean config flow

* further clean config flow

* deprecate old netgear discovery

* split out _async_remove_untracked_registries

* Update homeassistant/components/netgear/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* cleanup

* fix rename

* fix typo

* remove URL option

* fixes

* add sensor platform

* fixes

* fix removing multiple entities

* remove extra attributes

* initialize sensors correctly

* extra sensors disabled by default

* fix styling and unused imports

* fix tests

* Update .coveragerc

* fix requirements

* remove tracked list

* remove tracked registry editing

* fix styling

* fix discovery test

* simplify unload

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

Co-authored-by: J. Nick Koston <nick@koston.org>

* condense NetgearSensorEntities

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

* styling

* add typing

* use ForwardRefrence for typing

* Update homeassistant/components/netgear/device_tracker.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

* Apply suggestions from code review

Thanks!

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

* process review comments

* fix styling

* fix devicename not available on all models

* ensure DeviceName is not needed

* Update homeassistant/components/netgear/config_flow.py

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

* Update homeassistant/components/netgear/config_flow.py

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

* Update __init__.py

* fix styling

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-13 18:18:21 +02:00
Steven Looman 73260c5b88
Move parts of ssdp to async_upnp_client (#55540)
* Move parts of ssdp to async_upnp_client

* Fix test for environments with multiple sources

* Fix sonos tests

* More fixes/changes

* More fixes

* Use async_upnp_client==0.21.0

* Pylint/test fixes

* More changes after review

* Fix tests

* Improve testing

* Fix mypy

* Fix yamaha_musiccast tests?

* Changes after review

* Pylint

* Reduce calls to combined_headers

* Update to async_upnp_client==0.21.1

* Update to async_upnp_client==0.21.2

* use as_dict

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-11 13:38:16 -10:00
Erik Montnemery 3af4b2639b
Exclude @overload from coverage (#56021) 2021-09-09 21:24:23 +02:00
Alan Tse 98ecf2888c
Remove tesla integration (#55988)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-09-08 22:12:03 -07:00
Fuzzy efafe82799
Remove Trackr integration (API removed) (#55917)
* Delete Trackr component directory

* Update .coverage.rc to remove Trackr

* Update requirements_all.txt
2021-09-08 05:01:58 +02:00