1
mirror of https://github.com/home-assistant/core synced 2024-10-04 07:58:43 +02:00
Commit Graph

1813 Commits

Author SHA1 Message Date
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
Joakim Sørensen
470aa7e871
Add data update coordinator to the Tautulli integration (#54706)
* Add data update coordinator to the Tautulli integration

* update .coveragerc

* Add guard for UpdateFailed

* Apply suggestions from code review

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* ignore issues

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2021-08-27 20:39:12 -05:00
Milan Meulemans
d4b506e5e4
Add tests for Rituals init, sensor and switch (#52406) 2021-08-25 12:25:39 -05:00
Aaron Bach
6bc5c1c9af
Finish EntityDescription implementation for RainMachine (#55180) 2021-08-25 08:36:25 -06:00
Milan Meulemans
8570502681
Convert Nanoleaf yaml and discovery to config flow (#52199)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-08-24 14:09:36 -05:00
jan iversen
0ab99fc8bf
Activate mypy for surepetcare (#55079) 2021-08-24 11:21:57 +02:00
Maciej Bieniek
09b872d51f
Add sensor platform for Tractive integration (#54143)
* Add sensor platform

* Add extra_state_attributes

* Add more constants

* Add sensor.py to .coveragerc file

* Use native value

* Suggested change

* Move SENSOR_TYPES to sensor platform

* Add domain as prefix to the signal

* Use TractiveEntity class

* Add model.py to .coveragerc file

* Clean up files

* Add entity_class attribute to TractiveSensorEntityDescription class

* TractiveEntity inherits from Entity

* Suggested change

* Define _attr_icon as class attribute

Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
2021-08-24 00:20:28 +02:00
Robert Hillis
e5d6e18e30
Complete config flow tests for sense (#55040) 2021-08-23 07:58:42 +02:00
jan iversen
33f660118f
Add lazy_error_count to modbus (#54412)
* Add lazy_error_count.

* Use -=

* Review comments.
2021-08-21 15:49:50 +02:00
Joakim Plate
4bdeba8631
Add fjäråskupan sensor (#54921)
* Add fjäråskupan sensor

* Update homeassistant/components/fjaraskupan/sensor.py

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

* Type the return value of constructor

* Update __init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-21 11:09:23 +02:00
Joakim Plate
5142ebfcc2
Add fjäråskupan light entity (#54918)
* Add fjäråskupan light

* Update homeassistant/components/fjaraskupan/light.py

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

* Check property

* Switch to default coordinator update

* Type check constructor

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-21 09:34:32 +02:00
Joakim Plate
dd8542e01f
Add fjäråskupan binary_sensor (#54920)
* Add fjäråskupan binary_sensor

* Switch to entity description

* Type check constructor
2021-08-20 20:18:30 +02:00
Joakim Plate
1f4c12195e
Fjäråskupan kitchen fan (#53140)
* Add fjäråskupan fan control

* Update tests/components/fjaraskupan/conftest.py

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

* Update homeassistant/components/fjaraskupan/config_flow.py

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

* Update homeassistant/components/fjaraskupan/config_flow.py

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

* Increase manual update to 2 minutes

* Address review comments

* Switch to discovery flow

* Address more review comments

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-20 13:41:36 +02:00
Paulus Schoutsen
f1a4ba8bb0
Add Rainforest Eagle tests and price (#54887) 2021-08-19 13:19:31 -07:00
Paulus Schoutsen
4ae2a26aa3
Add config flow to Rainforest EAGLE-200 (#54846)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-19 09:22:30 -07:00
LonePurpleWolf
35f563e23e
Airtouch4 integration (#43513)
* airtouch 4 climate control integration

* enhance tests for airtouch. Fix linting issues

* Fix tests

* rework tests

* fix latest qa issues

* Clean up

* add already_configured message

* Use common string

* further qa fixes

* simplify airtouch4 domain storage

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-17 17:29:20 +02:00
jan iversen
69bc6bbe48
Activate mypy for google_pubsub (#54649) 2021-08-17 10:10:56 +02:00
J. Nick Koston
5e51f57f02
Convert nmap_tracker to be a config flow (#54715) 2021-08-16 15:19:32 -05:00
ehendrix23
f40c672cd2
Add light platform to MyQ (#54611)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-08-16 14:52:53 -05:00
ehendrix23
c040be423a
Updates to bump MyQ to 3.1.2 (#54488) 2021-08-11 22:17:25 -05:00
Martin Hjelmare
028a3d3e53
Complete mysensors sensor coverage (#54471) 2021-08-11 17:19:02 +02:00
Joakim Sørensen
d1ea38e8f0
Add 100% test coverage for Uptime Robot (#54314)
* Add 100% test coverage for Uptime Robot

* Update tests/components/uptimerobot/test_binary_sensor.py

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

* Add more typehints

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-10 16:29:51 +02:00
Maciej Bieniek
4459d8674a
Add binary_sensor platform for Xiaomi Miio integration (#54096) 2021-08-09 23:56:33 +02:00
Simone Chemelli
e0bc911e24
Fix Neato reauth flow when token expired (#52843)
* Fix Neato reauth flow when token expired

* Change and simplify approach

* Missing file

* Cleanup

* Update unique_id

* Added missing lamda

* Unique_id reworked

* Guard for id future ID changes

* Bump pybotvac: provide unique_id

* Address review comment

* Fix update check

* Remove token check

* Trigger reauth only for 401 and 403 code response

* Review comments
2021-08-07 12:22:08 +02:00
Joakim Sørensen
786a83f844
Add unique_id to Uptime Robot config_flow (#54055) 2021-08-05 14:58:29 +02:00
Gleb Sinyavskiy
25eb27cb9f
Add tractive integration (#51002)
* Scaffold

* Implement config flow

* Add dymmy device tracker and TractiveClient

* Add simple DeviceTracker

* Add device info

* Listen to tractive event and update tracker entities accordingly

* Refactoring

* Fix logging level

* Handle connection errors

* Remove sleep

* Fix logging

* Remove unused strings

* Replace username config with email

* Update aiotractive

* Use debug instead of info

* Cover config_flow

* Update .coveragerc

* Add quality scale to manifest

* pylint

* Update aiotractive

* Do not emit SERVER_AVAILABLE, properly handle availability

* Use async_get_clientsession

Co-authored-by:  Daniel Hjelseth Høyer <mail@dahoiv.net>

* Add @Danielhiversen as a codeowner

* Remove the title from strings and translations

* Update homeassistant/components/tractive/__init__.py

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

* Force CI

* Use _attr style properties instead of methods

* Remove entry_type

* Remove quality scale

* Make pyupgrade happy

Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-08-05 12:47:42 +02:00
Joakim Sørensen
caf0bdd5b9
Add config flow to uptimerobot (#53938) 2021-08-04 22:20:03 +02:00
Aidan Timson
18f4d125c3
System Bridge v2.3.0+ - Data from WebSocket (#53443)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-02 22:11:26 +02:00
Martin Hjelmare
007ecc51e5
Revert "Add Automate Pulse Hub v2 support (#39501)" (#53704) 2021-07-29 11:58:48 -07:00
Jan Bouwhuis
781015fb19
Xiaomi_Miio Humidifier rework (#52366)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-07-28 10:52:43 +02:00
Kuzj
d0b9d82287
Refactor bme280, add SPI support (#48775)
* bme280 refactoring, add SPI support

* isort, requirements

* __init_.py add to .coveragerc

* Re-run CI jobs

* const.py to .coveragerc

* Add support for IoT class in manifest

* Keepalive

* review suggestions

* scan_interval with coordinator

* black, isort

* coordinator review suggestions

* Set device_class

* review suggestions

* review suggestions

* review suggestions

* review suggestions

* review suggestions

* review suggestions

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

* add bme280spi to commented requirements

* run script.gen_requirements_all

* black

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-07-27 16:29:43 -04:00
Ron Klinkien
3488053648
Remove garmin_connect integration (#52808)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-07-27 21:49:49 +02:00
gjong
9f495fd200
Add initial version for the YouLess integration (#41942)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-07-27 17:42:15 +02:00
Jesse Hills
18bf0762b5
Add select entities to ESPHome (#53526)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-07-27 11:45:04 +02:00
G Johansson
f0d5ae2fec
Add yale_smart_alarm config flow and coordinator (#50850)
* config flow and coordinator

* comply with pylint

* Remove pylint errors

* Update test coverage yale smart alarm

* Update test config_flow

* Fix test already configured

* Second try test already configured

* Fixes config flow and tests

* Conform pylint errors coordinator

* Fix various review remarks

* Correct entity unique id

* Fix unique id and migrate entries

* Remove lock code

* Remove code from test

* Expand code coverage config flow test

* Add more constants

* Add test new requirements

* Minor corrections

* Resolve conflict alarm schema

* Change logger

* Changed from review

* Fix isort error

* Fix flake error

* Ignore mypy errors

* Corrections from PR review no 2

* Corrections from PR review no 3

* Added tests and fix pylint error

* Corrections from PR review no 4

* Corrections from PR review no 5

* Corrections from PR review no 6

* Corrections from PR review no 6_2

* Corrections from PR review no 7

* Corrections from PR review no 8

* Minor last changes for PR

* Update homeassistant/components/yale_smart_alarm/coordinator.py

Co-authored-by: Raman Gupta <7243222+raman325@users.noreply.github.com>
2021-07-24 13:55:43 -04:00
sillyfrog
d3e77e00e1
Add Automate Pulse Hub v2 support (#39501)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Sillyfrog <sillyfrog@users.noreply.github.com>
2021-07-22 14:40:33 +02:00
Rami Mosleh
1a450c2084
Speedtestdotnet code cleanup and type hints (#52533) 2021-07-22 12:25:54 +02:00
Robert Hillis
a1df3519db
Use entity class attributes for Bsblan (#53165) 2021-07-21 19:37:12 +02:00
Robert Hillis
462db1b4b2
Add config flow to nfandroidtv (#51280)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-07-21 13:31:54 +02:00
Daniel Hjelseth Høyer
e9ce3c57cd
Adax heaters (#50998)
Co-authored-by: G Johansson <62932417+gjohansson-ST@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-07-21 10:25:46 +02:00
Daniel Hjelseth Høyer
8a72e8df79
Convert Mill consumption attributes to sensors (#52311) 2021-07-20 22:41:08 -07:00
Daniel Hjelseth Høyer
f0b28c90bf
Co2signal configflow (#53193)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-07-19 21:30:00 -07:00
RDFurman
450fdc91e4
Add honeywell config flow (#50731)
* Upgrade honeywell from platform to integration

* Add codeowner and run code formatter

* Add sensors for current indoor temp and humidity

* Fix tests and away temp

* Spring cleaning of honeywell tests

* Add config flow to honeywell integration

* Add config flow test

* Tie in honeywell service update

* Simplify config flow and add import

* Remove unnecessary platform schema

* Clean up based on PR comments

* Use new helper method

* Force single device and fix linter errors

* Address PR feedback

* Update translations

* Change string key and remove logger message

* Always add first device

* Fix test assertion

* Put PLATFORM_SCHEMA back

* Skip code coverage check on honeywell init

* add some tests for honeywell

* Make retry async

* Make device private

* Use _attr_ instead of properties

* Code cleanup from PR feedback

* Fix test and cleanup code

* Make description better

Co-authored-by: Matt Zimmerman <mdz@alcor.net>
2021-07-19 09:44:02 -10:00
Shay Levy
ea6e325762
Add Switcher config flow discovery support (#52316) 2021-07-19 06:28:40 -07:00
Robert Hillis
7b27725ec1
Cleanup redundant coveragerc entries (#53171) 2021-07-19 12:00:38 +02:00
Robert Hillis
6b97a5ba8e
Fix hisense_aehw4a1 test exclusion (#53084)
* Fix hisense_aehw4a1 test coverage

* add back __init__

* remove from hassfest

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2021-07-18 19:17:36 -05:00
Robert Hillis
284e13464d
Fix home plus control coverage (#53087)
* Fix home_plus_control test coverage

* add back api, switch
2021-07-18 14:56:54 -05:00
Robert Hillis
fe22d5a675
Fix home_connect test coverage (#53086)
* Fix home_connect test coverage

* remove from hassfest exclusions
2021-07-18 14:54:43 -05:00
Robert Hillis
7d52c30e36
Revert "Fix google test coverage (#53060)" (#53085)
This reverts commit 4075e83732.
2021-07-16 07:13:34 -04:00
Robert Hillis
4075e83732
Fix google test coverage (#53060) 2021-07-15 20:56:57 -07:00
jan iversen
12ac666459
only allow one active call in each platform. (#52823) 2021-07-13 21:45:42 +02:00
Robert Hillis
3d419d1e8a
Fix flume converagerc (#52975) 2021-07-13 19:32:55 +02:00
Shulyaka
e9948100a7
Add generic hygrostat integration (#36759)
* generic_hygrostat: new integration
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: jan Iversen <jancasacondor@gmail.com>
2021-07-13 13:25:29 +02:00
J. Nick Koston
e6ea9f4708
Fix nexia thermostats humidify without dehumidify support (#52758) 2021-07-12 21:39:51 +02:00
jan iversen
2ecfd74fa4
Add more data_types to modbus (#52423)
* Add more data_types.

* Use new struct when writing temperature.
2021-07-12 07:58:45 +02:00
jan iversen
fe1f7ba316
Add check for _client existence in modbus (#52719) 2021-07-08 11:58:51 +02:00
J. Nick Koston
e1e3f68d0b
Revert nmap_tracker to 2021.6 version (#52573)
* Revert nmap_tracker to 2021.6 version

- Its unlikely we will be able to solve #52565 before release

* hassfest
2021-07-06 18:28:23 +02:00
Aaron Bach
5ce4de7bbb
Migrate AirVisual air_quality platform to sensor platform (#52349)
* Migrate AirVisual air_quality platform sensors

* Remove redundancy

* Cleanup

* Properly set available

* Unwind config_entry -> entry name change

* More unwinding

* Rename

* Update homeassistant/components/airvisual/sensor.py

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

* Code review

* Linting

Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-07-04 12:16:06 -06:00
Simone Chemelli
69b9a9c4ee
Merge fritzbox_netmonitor integration into fritz (#52264)
* Merge netmonitor integration

* cleanup additional files

* Use attrs instead of properties

* Add state_class to relevant sensors

* Update homeassistant/components/fritz/sensor.py

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

* Update homeassistant/components/fritz/sensor.py

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

* Update homeassistant/components/fritz/sensor.py

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

* Update homeassistant/components/fritz/sensor.py

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

* Update homeassistant/components/fritz/sensor.py

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

* Update homeassistant/components/fritz/sensor.py

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

* mypy fix + small cleanup

* Round, GB and icons

* Update homeassistant/components/fritz/sensor.py

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

* remove state_class from no-reset counters

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-07-03 16:26:43 +03:00
Robert Hillis
5cd4471c67
Add sensor platform to goalzero (#49835)
* Add sensor platform to goalzero

* Tweak

* Remove unused DATA_SCHEMA

* Simplify

* Remove last_reset

* Update on reload
2021-07-02 17:43:37 +02:00
Simone Chemelli
7959225fef
Add switch platform to Fritz (#51610)
* Add switch platform to Fritz

* Fix tests

* Pylint

* Small fix

* Bump fritzprofiles to fix log level and identifier

* Fix different WiFi networks with same name

* Changed exposed attributes

* Moved to extra_state

* Remove redundant lambda

* Add missing wait

* Removed identifiers

* Update homeassistant/components/fritz/switch.py

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

* Update homeassistant/components/fritz/switch.py

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

* Add mapping dict

* Device Profile disabled by default

* Heavy cleanup

* Tweak

* Bug fix

* Update homeassistant/components/fritz/switch.py

Co-authored-by: Aaron David Schneider <aaron.schneider@nbi.ku.dk>

* Fix port forward switching + small log improvement

* Cleanup from old approach

* Handle port mapping hot removal (from device)

* Minor fixes

* Typying

* Removed lambda call

* Last missing strict typing

* Split get entities

* Func rename

* Move FritzBoxBaseSwitch to switch.py

* Removed lambda

* Update homeassistant/components/fritz/common.py

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

* Update homeassistant/components/fritz/common.py

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

* Update homeassistant/components/fritz/switch.py

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

* Update homeassistant/components/fritz/switch.py

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

* Update homeassistant/components/fritz/switch.py

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

* Update homeassistant/components/fritz/switch.py

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

* Fixes after applying comments

* Remvoed redundant try block

* Removed broad-except

* Optimized async/sync switch

* Update homeassistant/components/fritz/switch.py

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

* Update homeassistant/components/fritz/switch.py

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

* Update homeassistant/components/fritz/switch.py

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

* Address remaining comments

* Optimize return list

* More optimization for return lists

* Some missing strict typing

* Redundant typing

* Update homeassistant/components/fritz/switch.py

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

* Wrong if

* Introduce const for profile status

* Update homeassistant/components/fritz/switch.py

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

* Update homeassistant/components/fritz/switch.py

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

* Fix mypy

* Switch back to get_local_ip()

* Address latest comments

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Aaron David Schneider <aaron.schneider@nbi.ku.dk>
2021-06-29 11:57:34 -04:00
Jesse Hills
e1797ea670
Add number entities to ESPHome (#52241)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-06-29 14:33:04 +02:00
Adrián Moreno
a639cb7ba7
Add sensor platform to Meteoclimatic integration (#51467)
* Add meteoclimatic sensor platform

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

* Add sensor.py to coverage file

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

* Add explicit return type None

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

* Fix sample station code

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

* Apply frenck suggestions

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

* Remove extra attributes

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

* Revert translations

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

* Remove None icons and classes

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
2021-06-29 13:52:39 +02:00
Milan Meulemans
6f41168616
Change DiffuserRoomSize number entity to select entity (#51993)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-06-28 20:20:32 +02:00
Andre Lengwenus
f2fe6c26ab
Add tests for LCN integration setup (#48070) 2021-06-28 18:08:09 +02:00
Tom Brien
fd1d110b80
Add config flow for Coinbase (#45354)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-06-28 16:38:12 +02:00
J. Nick Koston
583626a74f
Convert nmap_tracker to be a config flow (#50429) 2021-06-28 12:49:14 +02:00
Shay Levy
5795e76826
Migrate Switcher entity attributes to sensors (#51964)
* Migrate attributes to sensors

Migrate attributes to sensors

* Fix pylint

* Apply suggestions from code review

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

* Add typing imports

Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-06-22 18:28:09 +02:00
Artem Draft
db61a773fd
Add remote control platform to BraviaTV (#50845) 2021-06-17 12:33:44 +02:00
Tom Schneider
7e1fec8ee4
Rewrite of Yamaha musiccast integration (#51561)
* Initial commit for new musiccast integration

* Add zone support

* Get/set volume level

* Remove volume step

* Create custom MusicCastData type

* Create MusicCastDevice

* Fix await

* Add power and mute control

* Implement all basic media_player parts

* Support input switching

* Add duration/position support

* Add advanced tuner functions

* Basic media browser

* Add layer in media browser to see all available list_infos

* Added join/unjoin services and group informations. Known issue: You can not link zone 2 to main at the moment (WIP)

* Many fixes to make multiple zones and grouping work. Next step: implement error handling and remove debugging information

* WIP: Added Multizone Support and allows clients to directly jump from one group to another. Known issue: If a server tries to join a group as client, he has to close his group first. Sometimes the device that was a server previously jumps out of the group directly after joining.

* Updated group management to make it wait for the updated group information before performing the next actions - Timeouts after 1 second, then polls the distribution data. If the data are still not updated, there will be one retry before an Exception is thrown. Extended the state attributes for clients to make them return group details from their servers (leads to inactive group management buttons for the client). Added documentation and restructured the code.

* Make the service handle function name for group specific service calls unique

* Added service descriptions for set_sleep_timer, set_alarm, recall_netusb_preset, store_netusb_preset

* Added data entries for alarm specific values and a netusb preset list. Implemented fetching function for clock and netusb presets.

* Registered and implemented services for set_sleep_timer, set_alarm, recall_netusb_preset, store_netusb_preset. The set_alarm service works with a special mediaplayer alarm lovelace card, I am currently working on.
The NetUSB Presets are also available using the media browser. Maybe we could also add the Tuner presets in the future for both setting up the alarm and recalling them via service and media browser.

* Removed some debug prints

* Moved MusicCast Integration to the aiomusiccast library. This library supports media browsers with multiple pages. Added ssdp support for the discovery

* Minor fix in the group management and tidied up a bit

* Updated manifest of yamaha musiccast

* Update library

* Minor fix in the media browser. get_distribution_num does not have to be async, so it has been changed. Adjusted the client join function to turn on the client before joining a group - the musiccast app does so, so hopefully this fixes the rare errors when adding a turned off client to a group. Some reformating and by hooks fixed most of the requirements of the hooks. Known exception from this: mypy throws an error for line 116.

* Removed some old out commented code. Fixed some error handling, when the user enters a non reachable or non yamaha host in the manual setup. Fixed linting/styling errors. Implemented tests to bring the coverage for the config flow to 100%.

* Fixed linting/styling errors. Return a DeviceInfo object instead of a dict.

* Fixed linting/styling errors. Added a new error type to the translations.

* In the yamaha API the system_id is equal to the serial number in the DLNA description. Due to that it was possible to configure a device twice, because the serial number from the yamaha API was different. This issue was fixed.

* Updated tests and added a test for adding a device manually, which is already present in the system

* Remove print statements

* Fix sleep timer service call

* Fix yamllint error

* Shrink PR down to just new library + config flow with discovery

* Add __init__.py to .coveragerc

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>

* Implement suggestions from code review

* Improve identifiers and connections, remove event loop parameter

* Add coordinator back

* Better exception handling

* Fix unique id in ssdp step

* Remove abc.ABC from MusicCasteDeviceEntity

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

* Update homeassistant/components/yamaha_musiccast/config_flow.py

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

* Replace the repeat mode mapping from mc to ha by a generic solution

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

* add coordinator to the super call of the mediaplayer

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

* add the coordinator to the init function of the MusicCastEntity

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

* Pass the coordinator from the MusicCastEntity init function to the CoordinatorEntity init function

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

* merged _handle_config_flow into async_step_user

* reformated the exception handling of the user step. In the case that the device already exists, the AbortFlow will be raised.

* Removed model from the config entry. It was neither set nor used anymore.

* Fixed the test for the config flow.

* Use async_write_ha_state instead of schedule_update_ha_state.

* Add default value for the system ID gotten in the user step

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

* Update tests/components/yamaha_musiccast/test_config_flow.py

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

* Added a fixture to avoid IO in the test_user_input_device_not_found test

* Use absolute imprt to import data_entry_flow.

* Use local vars for host and serial_number in async_step_user.

* Remove ip_address and zone_id properties.

* Use device id for the unique ID of an entity instead of the macs

* Removed entry_id from the MusicCastEntity init function.

* Updated strings and English translation.

* don't set the coordinator in the mediaplayer init.

* Implemented legacy configuration.yaml support for existing configurations.

* Added tests for the newly added config flow step.

* Use device_id as identifier

* Fix an accidentally relative import

* Fix pylint warnings

* use logger.error instead of logger.exception in the import step.

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

* Use CONF_HOST instead of 'host'

* Only support the import from configuration.yaml if no config entries are setup for musiccast. If there are already config entries in HA and none of them is a representation of a config given in configuration.yaml (e.g. config added after the first import), an error will be logged.

* Update homeassistant/components/yamaha_musiccast/media_player.py

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

* Readded PLATFORM_SCHEMA for configuration.yaml

* Raise an exception for all services, which are only supported for specific sources.

* Bump aiomusiccast to 0.6 to support asyncio sockets

Co-authored-by: Michael Harbarth <michael.harbarth@gmx.de>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-06-14 08:58:42 +02:00
Brent Petit
5cc31a98e2
Add Ecobee humidifier device_info and unique_id (#51504)
* Add Ecobee humidifier device_info and unique_id

Ecobee humidifier entity was not connected to the thermostat device.
This change will ensure the entitiy is properly connected.

This change also fills out the ecobee-data.json fixutre data a bit
to address failures in the test setup.

* Add Ecobee humidifier device_info and unique_id

Adjust test fixture data to increase pytest coverage
Clean up indenting in ecobee-data.json

* Add Ecobee humidifier device_info and unique_id

Update exception case in device_info to not
be included in codecov tests. This case has
been tested locally.

* Add Ecobee humidifier device_info and unique_id

Address pylint issue

* Add Ecobee humidifier device_info and unique_id

Remove no cover pragma and add ecobee humidifier.py to
.coveragerc
2021-06-11 17:39:57 +02:00
Franck Nijhof
e5c6ac5ba8
Add 100% test coverage to Ambee integration (#51670)
* Add 100% test coverage to Ambee integration

* Add tests for device and entity registry
2021-06-09 20:23:16 +02:00
Franck Nijhof
d021e593d3
Add Ambee integration (#51645) 2021-06-09 13:22:37 +02:00
Milan Meulemans
d0a8e27036
Add Rituals number platform (#49723) 2021-06-08 03:28:31 +02:00
J. Nick Koston
ccf4b5a265
Move remaining code out of netdisco to eliminate as SSDP dependency (#51588) 2021-06-07 22:12:33 +02:00
Thomas Schamm
ffe8b3e49b
Add bosch shc platforms for sensor devices (#50720) 2021-06-03 14:39:42 +02:00
Eduard van Valkenburg
e8762bdea1
Add binary sensor platform to SIA integration (#51206)
* add support for binary_sensor

* added default enabled for binary sensors

* fixed coverage and a import deleted

* disable pylint for line

* Apply suggestions from code review

* split binary sensor and used more attr fields

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-06-03 08:39:44 +02:00
Guido Schmitz
3de29a7606
Add binary_sensor tests for devolo Home Control (#49843)
Co-authored-by: Markus Bong <Markus.Bong@devolo.de>
2021-06-02 13:59:35 +02:00
Franck Nijhof
5d33cd05a8
SolarEdge: Move coordinators out of sensor platform (#51348) 2021-06-01 22:50:32 +02:00
Joakim Plate
6631a4e605
Philips TV ambilight support (#44867) 2021-05-31 14:39:28 -07:00
Martin Hjelmare
bdb8cdf717
Fix zwave_js None color value (#50926) 2021-05-25 13:40:22 +02:00
Adrián Moreno
fe34f42aa5
Add new Meteoclimatic integration (#36906)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-25 13:11:48 +02:00
Eduard van Valkenburg
0bba0f07ac
Add SIA Alarm systems (#36625)
* initial commit of SIA integration

* translations

* moved reactions to file, typed everything

* fixed no-else-return 3 times

* refactored config and fix coverage of test

* fix requirements_test

* elimated another platform

* forgot some mentions of sensor

* updated config flow steps, fixed restore and small edits

* fixed pylint

* updated config_flow with better schema, small fixes from review

* final comment and small legibility enhancements

* small fix for pylint

* fixed init

* fixes for botched rebase

* fixed port string

* updated common strings

* rebuild component with eventbus

* fixed pylint and tests

* updates based on review by @bdraco

* updates based on new version of package and reviews

* small updates with latest package

* added raise from

* deleted async_setup from test

* fixed tests

* removed unused code from addititional account step

* fixed typo in strings

* clarification and update to update_data func

* added iot_class to manifest

* fixed entity and unique id setup

* small fix in tests

* improved unique_id semantics and load/unload functions

* added typing in order to fix mypy

* further fixes for typing

* final fixes for mypy

* adding None return types

* fix hub DR identifier

* rebased, added DeviceInfo

* rewrite to clean up and make it easier to read

* replaced functions with format for id and name

* renamed tracker remover small fix in state.setter

* improved readibility of state.setter

* no more state.setter and small updates

* mypy fix

* fixed and improved config flow

* added fixtures to test and other cleaner test code

* removed timeband from config, will reintro in a options flow

* removed timeband from tests

* added options flow for zones and timestamps

* removed type ignore

* replaced mapping with collections.abc
2021-05-24 08:48:28 +02:00
jan iversen
f55213d8b1
Update modbus cover to 100% coverage (#50996) 2021-05-23 10:18:35 -05:00
Simone Chemelli
b9a0fb93eb
Add samsungtv dhcp and zeroconf discovery (#48022)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-05-22 10:41:18 -05:00
Michael
8c5c8ed153
Add strict type annotations to fitbit (#50740)
* add strict type annotations

* cast json_load()

* apply suggestions

* move SCAN_INTERVAL back to platform file

* apply suggestion

* apply suggestion

* apply suggestions

* rename to PARENT_PLATFORM_SCHEMA
2021-05-21 13:33:54 +01:00
jan iversen
892a2a0372
Push modbus switch to 100% test coverage (#50324)
push modbus switch to 100% test coverage.
2021-05-19 15:05:29 +02:00
Michael
df6862a519
Add strict type annotations to amazon_polly (#50697)
* add strict type annotations

* apply suggestions

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-05-17 14:09:52 +02:00
Austin Mroczek
a9c73ac264
Fix armed_night logic in totalconnect alarm and add tests (#50694)
* Fix armed_night, add tests for alarm

* end assertions with expected values
2021-05-17 13:18:50 +02:00
Michael
edccb7eb58
Add strict type annotations to actiontect (#50672)
* add strict type annotations

* fix pylint, add coverage omit

* apply suggestions

* fix rebase conflict

* import PLATFORM_SCHEMA as BASE_PLATFORM_SCHEMA

* correct get_device_name() return annotation
2021-05-16 00:59:57 +03:00
Michael
7f6b8bbd1e
Add strict type annotations to aladdin_connect (#50693)
* add strict type annotations

* add missing return type annotation
2021-05-15 23:53:42 +03:00
Michael
bc006c9ecc
Add strict type annotations to aftership (#50692)
* add strict type annotations

* import PLATFORM_SCHEMA as BASE_PLATFORM_SCHEMA

* bring needed return back
2021-05-15 23:53:10 +03:00
Klaas Schoute
e1dd479e15
Add Garages Amsterdam integration (#43157)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-05-15 20:43:12 +02:00
Michael
562e0d785d
Add strict type annotations to acer_projector (#50657) 2021-05-15 19:55:28 +02:00
Thomas Schamm
8fcf06a2a9
Add bosch_shc supporting Bosch Smart Home Controller (#34063)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-14 15:03:26 +02:00
Álvaro Fernández Rojas
9247a157d8
Add AEMET conditional station updates (#50227) 2021-05-14 13:28:48 +02:00
Simone Chemelli
d877c0c1ff
Add Fritz services (#50056) 2021-05-11 15:56:52 -05:00
Martin Hjelmare
f71eb4d34d
Clean somfy config flow tests (#50461) 2021-05-11 16:19:07 +02:00
indykoning
85f758380a
Add Growatt Server Config flow (#41303)
* Growatt Server Config flow

* Use reference strings

Co-authored-by: SNoof85 <snoof85@gmail.com>

* Remove configuration.yaml import logic

* Removed import test

* Re-added PLATFORM_SCHEMA validation

* Import yaml from old yaml configuration

* Apply suggestions from code review

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

* Feedback

* Use Executor for IO only

* Fix imports

* update requirements

* Fix flake8

* Run every section of fetching devices in single executor

* Config flow feedback

* Clean up

* Fix plan step

* Fix config flow test

* Remove duplicate test

* Test import step

* Test already configured entry

* Clean up tests

* Add asserts

* Mock out entry setup

* Add warning if set up via yaml

Co-authored-by: SNoof85 <snoof85@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-10 22:46:50 +02:00
Franck Nijhof
717f4e69d5
Remove defunct Spot Crime integration (#50361) 2021-05-09 22:23:52 +02:00
Gleb Sinyavskiy
52b1a416d9
Remove the N26 integration (#50292) 2021-05-09 00:58:23 +02:00
Gleb Sinyavskiy
97eb4c6c62
Add syncthing integration (#38331)
* Scaffold the integration

* Add config flow data schema

* Handle configuration errors

* Get folder states

* Support https

* Fix translations

* Listen to syncthing events in a separate thread

* Bump syncthing

* Automatically reconnect to the syncthing server

* Renames

* Improve loading and unloading

* Update folder states from events

* Refactoring, handle FolderPaused event

* Dynamic folder icons

* Refactoring

* Mark folders as unavailable when senrver is unavailable

* Update folder satus when server is available

* Raise PlatformNotReady

* Implement additional polling

* Stop polling when the server is not available

* Minor fixes

* Remove logging

* Check name uniqueness

* Refactoring

* Minor refactorings

* Bump python-syncthing

* Migrate to aiosyncthing

* Minor fixes

* Update .coveragerc

* Set quality scale

* Bump aiosyncthing, properly handle invalid token

* Fix logging

* Fix logging

* Use CONF_VERIFY_SSL from homeassistant.const

* Bump aiosyncthing. Add Syncthing device

* Fix device name

* Bump aiosyncthing

* Bump aiosyncthing

* Extract SyncthingClient

* Add folder to device_state_attributes

* Do not pass the loop

* Cover config_flow.py

* Move self.async_create_entry outside of the try block

* Raise ConfigEntryNotReady if syncthing server is not reachable

* Fix already configured error message

* Change default name to Syncthing

* Bump aiosyncthing

* Fix formatting

* Fix formatting

* Fix tests

* Fix typo, use lis comprehension

* Fix typo, remove unused CONFIG_SCHEMA

* Bump aiosyncthing

* Remove periods from log messages W0001

* Fix tests

* Black, isort

* Remove empty items from manifest.json

* Fix variable naming

* Remove async_setup

* Use SensorEntity

* Use asyncio.create_task instead of self._hass.loop.create_task

* Do not pass hass to FolderSensor initializer

* Rename device_state_attributes to extra_state_attributes

* Use callbacks

* Simplify tests

* Refactor _listen()

* Use url for the title

* Use the url instead of the name to identify the config entry

* Explicitly set sensor attributes, extract _filter_state

* Use server url instead of name in device_info

* Use server url instead of name in logs

* User server id as a device identifier

* Use URL instead of name to identify config entry

* Use shortened server id instead of name to build entity name and unique id

* Do not use CONF_NAME

* Cleanup unused strings

* Cleanup unused strings

* Add IOT class

* Scaffold the integration

* Add config flow data schema

* Handle configuration errors

* Get folder states

* Support https

* Fix translations

* Listen to syncthing events in a separate thread

* Bump syncthing

* Automatically reconnect to the syncthing server

* Renames

* Improve loading and unloading

* Update folder states from events

* Refactoring, handle FolderPaused event

* Dynamic folder icons

* Refactoring

* Mark folders as unavailable when senrver is unavailable

* Update folder satus when server is available

* Raise PlatformNotReady

* Implement additional polling

* Stop polling when the server is not available

* Minor fixes

* Remove logging

* Check name uniqueness

* Refactoring

* Minor refactorings

* Bump python-syncthing

* Migrate to aiosyncthing

* Minor fixes

* Update .coveragerc

* Set quality scale

* Bump aiosyncthing, properly handle invalid token

* Fix logging

* Fix logging

* Use CONF_VERIFY_SSL from homeassistant.const

* Bump aiosyncthing. Add Syncthing device

* Fix device name

* Bump aiosyncthing

* Bump aiosyncthing

* Extract SyncthingClient

* Add folder to device_state_attributes

* Do not pass the loop

* Cover config_flow.py

* Move self.async_create_entry outside of the try block

* Raise ConfigEntryNotReady if syncthing server is not reachable

* Fix already configured error message

* Change default name to Syncthing

* Bump aiosyncthing

* Fix formatting

* Fix formatting

* Fix tests

* Fix typo, use lis comprehension

* Fix typo, remove unused CONFIG_SCHEMA

* Bump aiosyncthing

* Remove periods from log messages W0001

* Fix tests

* Black, isort

* Remove empty items from manifest.json

* Fix variable naming

* Remove async_setup

* Use SensorEntity

* Use asyncio.create_task instead of self._hass.loop.create_task

* Do not pass hass to FolderSensor initializer

* Rename device_state_attributes to extra_state_attributes

* Use callbacks

* Simplify tests

* Refactor _listen()

* Use url for the title

* Use the url instead of the name to identify the config entry

* Explicitly set sensor attributes, extract _filter_state

* Use server url instead of name in device_info

* Use server url instead of name in logs

* User server id as a device identifier

* Use URL instead of name to identify config entry

* Use shortened server id instead of name to build entity name and unique id

* Do not use CONF_NAME

* Cleanup unused strings

* Cleanup unused strings

* Add IOT class

* Apply suggestions from code review

* Clean up

* Fix dict comprehension

* Clean sensor

* Use the server ID as a config entry unique ID

* Remove the AlreadyConfigured exception

* Clean up old error string

* Format json

* Convert sensor attributes to snake case

* Force CI

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-08 19:12:14 +02:00
Simone Chemelli
4d0955bae1
Add Fritz sensors (#50055)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-05-07 09:05:16 -05:00
Aidan Timson
e4ef06d6b1
System Bridge Integration (#48156)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-06 01:33:32 +02:00
Franck Nijhof
34eb1627e0
Remove deprecated LIFX Legacy integration (#50069) 2021-05-04 14:25:59 -07:00
Niels Mündler
2eae87fb1b
Add SyncThru binary sensors (#48114)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-04 08:28:45 +02:00
Simone Chemelli
55c96ae86f
Create Fritz device and connectivity sensor (#49699)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-05-03 17:11:21 -10:00
J. Nick Koston
42c48e8cf9
Add reauth support to myq (#49998) 2021-05-02 21:52:48 -07:00
jan iversen
760caeed85
Complete modbus device response tests (#49633)
* Prepare test harness for new pymodbus return types.

Use pytest.fixture to mock pymodbus.
Use pytest.fixture to load modbus using mocked pymodbus
Add test of Exception/IllegalResponse/ExceptionResponse from pymodbus.

* Modbus.py is back at 100% test coverage.

* Added assert mock.called.

* add mock reset.
2021-04-29 18:06:56 +02:00
djtimca
f7cf82be6d
Add Omnilogic Switch platform (#42116)
* Bump omnilogic dependency to 0.4.4 to fix Lights key error.

* Bumped dependency to 0.4.5.

* Fixed pump type issue for unique pool structure.

* Create full platform bundle for final testing and PR to Home Assistant dev.

* Removed logger instances not required.

* Fixed lint issues.

* Fixed pylint issues.

* Fix pylint issues. Fix issue with pH sensor offset.

* Stripped light, water_heater platform for PR submit.

* Correct pH and ORP sensor report to unknown with offset if pump is off.

* Moving guard condition check to helper function.

* Update to asyncio.sleep to wait for switch status delay in Hayward API status.

* Removed sleep, added state delay to handle slow Hayward API state update response.

* Fix flake8 issue.

* Fix flake8 issue.

* Fix isort issue.

* Addressed PR Comments.

* Addressed PR comments. Corrected Unit of Measure for sensor where pump speed is not variable.

* Fix pylint issue.

* Address pylint issue.

* Update homeassistant/components/omnilogic/switch.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-04-29 16:46:04 +02:00
jan iversen
5b6d2edb48
Catch missing/unavailable response from modbus (#49632)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-29 15:59:17 +02:00
tkdrob
74f95ac338
Add switch platform to goalzero (#48612)
* Add switch platform to goalzero

* fix update interval

* Apply some suggested changes

* pass device class to parent

* Drop passing device_class

* Tweaks

* Drop underscore prefix
2021-04-28 21:24:56 +02:00
Tom Toor
a57761103c
Mutesync integration (#49679)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-27 13:44:59 -07:00
Simone Chemelli
b92f29997e
Rework Fritz config_flow and device_tracker (#48287)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-04-25 00:10:33 -10:00
jan iversen
f67c0ce8bb
Secure 100% test coverage for modbus, binary_sensor and sensor (#49521)
* Secure 100% test coverage for modbus/binary_sensor.

* Test that class constructor is called.
2021-04-22 11:54:40 +02:00
Kevin Worrel
dc24ce491b
Add Screenlogic set_color_mode service (#49366) 2021-04-21 08:45:50 -10:00
jan iversen
c14e525ac3
Update modbus state when sensor fails (#49481) 2021-04-20 14:54:20 +02:00
Martin Hjelmare
41ed1f818c
Exclude epson init module from coverage (#49316) 2021-04-17 08:57:21 +02:00
J. Nick Koston
7a40d0f1c2
Disconnect roomba on stop event (#49235) 2021-04-15 11:24:43 +02:00
Milan Meulemans
ed54494b69
Add binary sensor platform to Rituals Perfume Genie Integration (#49207)
* Add binary sensor platform to Rituals

* Sort platforms
2021-04-14 23:10:35 +02:00
René Klomp
926c2489f0
Implement SMA config flow (#48003)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Johann Kellerman <kellerza@gmail.com>
2021-04-13 06:21:01 -10:00
Milan Meulemans
71e0e42792
Add Rituals Perfume Genie sensor platform (#48270)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-04-11 10:36:44 -10:00
Ludovico de Nittis
30618aae94
Reintroduce iAlarm integration (#43525)
The previous iAlarm integration has been removed because it used
webscraping #43010.

Since then, the pyialarm library has been updated to use the iAlarm API
instead.

With this commit I reintroduce the iAlarm integration, leveraging the
new HA config flow.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2021-04-11 10:35:04 -10:00
J. Nick Koston
4cd7f9bd8b
Raise ConfigEntryAuthFailed during setup or coordinator update to start reauth (#48962) 2021-04-09 19:41:29 -10:00
RenierM26
155322584d
Update Ezviz Component (#45722)
* Update Ezviz Component

* Update Ezviz for pylint test

* Update Ezviz component pylint tests

* Update Ezviz component tests

* Update Ezviz Component tests

* Update Ezviz component pylint error

* Fix ezviz component config flow tests

* Update ezviz component

* Update Ezviz component

* Add sensor platforms

* issue with requirements file

* Update binary_sensor to include switches

* Updates to Ezviz sensors

* Removed enum private method.

* Fix switch args

* Update homeassistant/components/ezviz/switch.py

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

* config flow checks login info

* Config_flow now imports ezviz from camera platform

* Update test

* Updated config_flow with unique_id and remove period from logging

* Added two camera services and clarified service descryptions in services.yaml

* Fixed variable name mistake with new service

* Added french integration translation

* Config_flow add camera rtsp credentials as seperate entities, with user step and import step

* rerun hassfest after rebase

* Removed region from legacy config schema, removed logging in camera platform setup that could contain credentials, removed unused constant.

* Regenerate requirements

* Fix tests and add config_flow import config test

* Added addition test to config_flow to test successfull camera entity create.

* Add to tests method to end in create entry, config_flow cleanup, use entry instead of entry.data

* Removed all services, sorted platforms in init file.

* Changed RTSP logging to debug from warning. (Forgot to change this before commit)

* Cleanup typing, change platform order, bump pyezviz version

* Added types to entries, allow creation of main entry if deleted by validating existance of type

* Config_flow doesn't store serial under entry data, camera rtsp read from entry and not stored in hass, removed duplicate abort if unique id from config flow

* Fix test of config_flow

* Update tests/components/ezviz/test_config_flow.py

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

* Update tests/components/ezviz/test_config_flow.py

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

* Update tests/components/ezviz/test_config_flow.py

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

* Bumped pyezviz api version, added api pyezvizerror exception raised in api (on HTTPError), cleanup unused imports.

* rebase

* cleanup coordinator, bump pyezviz api version, move async_setup_entry to add entry options to camera entries. (order change)

* Added discovery step in config_flow if cameras detected without rtsp config entry

* Reload main integration after addition or completion of camera rtsp config entry

* Add tests for discovery config_flow, added a few other output asserts

* Camera platform call discover flow with hass.async_create_task. Fixes to config_flow for discovery step

* Fix config_flow discovery, add check to legacy yaml camera platform import, move camera private method to camera import step

* Remove not needed check from config_flow import step.

* Cleanup config_flow

* Added config_flow description for discovered camera

* Reordered description in config_flow confim step.

* Added serial to flow_step description for discovered camera, readded camera attributes for rtsp stream url (allows user to check RTSP cred), added local ip and firmware upgade available.

* Bumped pyezviz version and changed region code to region url. (Russia uses a completly different url). PyEzviz adds a Local IP sensor, removed camera entity attributes.

* Add RSTP describe auth check from API to config_flow

* url as vol.in options in Config_flow

* Config_flow changes to discovery step, added exceptions, fixed tests, added rtsp config validate module mock to test disovery confirm step

* Add test for config_flow step user_camera

* Added tests for abort flow

* Extend tests on custom url flow step

* Fix exceptions in config_flow, fix test for discovery import exception test

* Bump pyezviz api version

* Bump api version, added config_flow function to wake hybernating camera before testing credentials, removed "user camera" step from config flow not needed as cameras are discovered.

* Create pyezviz Api instance for config_flow wake hybernating camera, fixed tests and added fixture to mock method

* Added alarm_control_panel with support to arm/disarm all cameras, fixed camera is available attribute (returns 2 if unavailable, 1 if available)

* Skip ignored entities when setup up camera RTSP stream

* Remove alarm_control_panel, add additional config_flow tests

* Cleanup tests, add tests for discovery_step.

* Add test for config_flow rtsp test step1 exceptions

* Removed redundant except from second step in test RTSP method

* All tests to CREATE or ABORT, added step exception for general HTTP error so user can retry in case of trasient network condition

* Ammended tests with output checks for step_id, error, data, create entry method calls.

* bumped ezviz api now rases library exceptions. Config_flow, coordiantor and init raises library exceptions. Updated test sideeffect for library exceptions

* Bump api version, Create mock ezviz cloud account on discovery tests first to allow more complete testing of step.

* Add abort to rtsp verification method if cloud account was deleted and add tests

* Update tests/components/ezviz/__init__.py

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

* Update homeassistant/components/ezviz/const.py

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

* Update tests/components/ezviz/__init__.py

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

* Update homeassistant/components/ezviz/camera.py

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

* Update homeassistant/components/ezviz/camera.py

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

* Update homeassistant/components/ezviz/camera.py

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

* Update homeassistant/components/ezviz/camera.py

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

* Update homeassistant/components/ezviz/camera.py

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

* Update homeassistant/components/ezviz/camera.py

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

* Undo config import change to password key for yaml, move hass.data.setdefault to async_setup_entry and remove async_setup

* Fixed tests by removing _patch_async_setup as this was removed from init.

* Update homeassistant/components/ezviz/camera.py

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

* Update homeassistant/components/ezviz/camera.py

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

* Update homeassistant/components/ezviz/camera.py

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

* Changed L67 on camera config to complete suggestion for cleanup

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-09 12:39:19 +02:00
stegm
589f2240b1
New integration for Kostal Plenticore solar inverters (#43404)
* New integration for Kostal Plenticore solar inverters.

* Fix errors from github pipeline.

* Fixed test for py37.

* Add more test for test coverage check.

* Try to fix test coverage check.

* Fix import sort order.

* Try fix test code coverage .

* Mock api client for tests.

* Fix typo.

* Fix order of rebased code from dev.

* Add new data point for home power.

* Modifications to review.
Remove service for write access (for first pull request). Refactor
update coordinator to not use the entity API.

* Fixed mock imports.

* Ignore new python module on coverage.

* Changes after review.

* Fixed unit test because of config title.

* Fixes from review.

* Changes from review (unique id and mocking of tests)

* Use async update method. Change unique id. Remove _dict

* Remove _data field.

* Removed login flag from PlenticoreUpdateCoordinator.

* Removed Dynamic SoC sensor because it should be a binary sensor.

* Remove more sensors because they are binary sensors.
2021-04-07 09:18:07 +02:00
Pascal Reeb
fb1444c414
Add doorsensor + coordinator to nuki (#40933)
* implemented coordinator + doorsensor

* added async_unload_entry

* small fixes + reauth_flow

* update function

* black

* define _data inside __init__

* removed unused property

* await on update & coverage for binary_sensor

* keep reauth seperate from validate

* setting entities unavailable when connection goes down

* add unknown error when entity is not present

* override extra_state_attributes()

* removed unnecessary else

* moved to locks & openers variables

* removed doorsensorState attribute

* changed config entry reload to a task

* wait for reload
2021-04-06 21:20:57 +02:00
Raman Gupta
5305d083ec
Add config flow for Waze Travel Time (#43419)
* Add config flow for Waze Travel Time

* update translations

* setup entry is async

* fix update logic during setup

* support old config method in the interim

* fix requirements

* fix requirements

* add abort string

* changes based on @bdraco review

* fix tests

* add device identifier

* Update homeassistant/components/waze_travel_time/__init__.py

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

* fix tests

* Update homeassistant/components/waze_travel_time/sensor.py

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

* log warning for deprecation message

* PR feedback

* fix tests and bugs

* re-add name to config schema to avoid breaking change

* handle if we get name from config in entry title

* fix name logic

* always set up options with defaults

* Update homeassistant/components/waze_travel_time/sensor.py

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

* Update config_flow.py

* Update sensor.py

* handle options updates by getting options on every update

* patch library instead of sensor

* fixes and make sure first update writes the state

* validate config entry data during config flow and entry setup

* fix input parameters

* fix tests

* invert if statement

* remove unnecessary else

* exclude helpers from coverage

* remove async_setup because it's no longer needed

* fix patch statements

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-05 19:25:52 -04:00
Dylan Gore
f3399aa8aa
Add a new weather integration - Met Éireann (#39429)
* Added a new weather integration - Met Éireann

* Fix codespell error

* Update met_eireann to use CoordinatorEntity

* Remove deprecated platform setup

* Fix merge conflict

* Remove unnecessary onboarding/home tracking code

* Use common strings for config flow

* Remove unnecessary code

* Switch to using unique IDs in config flow

* Use constants where possible

* Fix failing tests

* Fix isort errors

* Remove unnecessary DataUpdateCoordinator class

* Add device info

* Explicitly define forecast data

* Disable hourly forecast entity by default

* Update config flow to reflect requested changes

* Cleanup code

* Update entity naming to match other similar components

* Convert forecast time to UTC

* Fix test coverage

* Update test coverage

* Remove elevation conversion

* Update translations for additional clarity

* Remove en-GB translation
2021-04-05 23:23:57 +02:00
Raman Gupta
d0b3f76a6f
Add ClimaCell v4 API support (#47575)
* Add ClimaCell v4 API support

* fix tests

* use constants

* fix logic and update tests

* revert accidental changes and enable hourly and nowcast forecast entities in test

* use variable instead of accessing dictionary multiple times

* only grab necessary fields

* add _translate_condition method ot base class

* bump pyclimacell again to fix bug

* switch typehints back to new format

* more typehint fixes

* fix tests

* revert merge conflict change

* handle 'migration' in async_setup_entry so we don't have to bump config entry versions

* parametrize timestep test
2021-04-05 13:39:39 -04:00
J. Nick Koston
e925fd2228
Add emonitor integration (#48310)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-04-04 22:11:23 -10:00
J. Nick Koston
94fde73add
Add config flow for enphase envoy (#48517)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-04-04 22:11:06 -10:00
Franck Nijhof
b34cc7ef2c
Remove Social Blade integration (ADR-0004) (#48677)
* Remove Social Blade integration (ADR-0004)

* Cleanup coveragerc
2021-04-04 20:40:08 +02:00
Oliver
eed3bfc762
Going async with denonavr (#47920)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-04-02 07:47:16 -10:00
Franck Nijhof
e76503ddc3
Remove Geizhals integration (ADR-0004) (#48594) 2021-04-02 00:04:52 +02:00
Raman Gupta
aae0ccc588
Add config flow support to google_travel_time (#43509)
* add config flow support to google_travel_time

* fix bugs and add strings

* fix import and add new test

* address comments in #43419 since this is a similar PR

* fix default name and test

* add unique ID and device info

* fix test

* feedback from waze PR

* continue incorporating feedback from waze PR

* final fixes and update tests

* call update in lambda

* Update homeassistant/components/google_travel_time/sensor.py

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

* additional fixes

* validate config entry data during config flow and config entry setup

* don't store entity

* patch dependency instead of HA code

* fixes

* improve tests by moving all patching to fixtures

* use self.hass instead of setting self._hass

* invert if

* remove unnecessary else

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-31 22:10:24 +02:00
J. Nick Koston
bee55a0494
Prevent ping integration from delaying startup (#43869) 2021-03-31 15:06:49 +02:00
Unai
4a353efdfb
Add Maxcube unit tests (#47872)
* Simplify maxcube integration

Device objects returned by maxcube-api dependency are stable, so
we do not need to resolve from the device address every time.

Also, refactor and unify how maxcube integration sets temperature & mode.

* Add tests for maxcube component

* Use homeassistant.util.utcnow to retrieve current time

* Revert "Simplify maxcube integration"

This reverts commit 84d231d5bd.

* Make test pass again after rolling back integration changes
2021-03-27 12:42:23 +01:00
Tobias Sauerwein
ec1334099e
Add tests for Netatmo data handler (#46373)
* Add tests for Netatmo data handler

* Clean up coveragerc

* Move block to fixture

* Minor update

* Remove tests of implementation details for data handler

* Update homeassistant/components/netatmo/data_handler.py

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

* Update homeassistant/components/netatmo/data_handler.py

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

* Import callback

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-25 19:07:45 +01:00
William Scanlon
4f4a6fd6a5
Add econet thermostat support and use getattr for sensors (#45564)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-25 17:06:51 +01:00
chemaaa
1b60c8efb8
Add Homepluscontrol integration (#46783)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-25 14:12:31 +01:00
Tobias Sauerwein
0d699bb768
Add tests for Netatmo sensor (#46393)
* Add tests for Netatmo sensor

* Fix coveragerc

* Remove freezegun dependency

* Use f-strings instead of string concatenation

* Update tests/components/netatmo/test_sensor.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Address comment on config options test

* Replace deprecated call to async_get_registry()

* Fix public weather sensor update test

* Clean up

* Prevent division by zero

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-24 07:17:51 +01:00
Tobias Sauerwein
9656f260a4
Add tests for Netatmo (#46372)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-23 14:28:35 +01:00
Kevin Worrel
fb48fd7d10
ScreenLogic cleanups (#48136)
* ScreenLogic cleanup.
Bump screenlogicpy to 0.2.0.
Move heating functions from water_heater to climate platform.
Address notes from original PR.

* Fix temperature attribute

* Addressing notes.
Bump screenlogicpy to 0.2.1.
Made device_types constants.
Made (known) equipment flags constants.
Used dict.get() in places where None is the default.
Return fast with good _last_preset.

* Update homeassistant/components/screenlogic/climate.py

Let base entity handle state property.

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

* Patch integration setup functions.

* Exception, ATTR_TEMPERATURE notes

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-03-21 11:56:46 +01:00
Tobias Sauerwein
365e8a74ee
Add tests for Netatmo webhook handler (#46396)
* Add tests for Netatmo webhook handler

* Add async prefix

* Remove freezegun dependency

* Clean up
2021-03-20 08:26:11 +01:00
Tobias Sauerwein
4ee4d674d8
Add tests for Netatmo camera (#46380)
* Add test for Netatmo camera

* Improve docstrings

* Remove light tests

* Remove freezegun from tests

* Update camera tests

* Remove freezegun dependency

* Update tests/components/netatmo/test_camera.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update tests/components/netatmo/test_camera.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Deduplication of the fake webhook payload

* Mock pyatmo instead of checking the logs

* Clean up

* Further deduplication

* Assert function arguments

* Rename mocked functions

* Update .coveragerc

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-03-19 12:19:57 +01:00
Tobias Sauerwein
aaafe399a1
Add tests for Netatmo light (#46381)
* Add tests for Netatmo light

* Improve docstring

* Register the camera data class for the light platform

* Remove freezegun dependency

* Update tests

* Update tests/components/netatmo/test_light.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Deduplicate webhook test data

* Mock pytest to verify it is called

* Don't test internals

* Rename

* Assert light still on with erroneous event data

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-03-19 12:19:27 +01:00
Tobias Sauerwein
7d196abc4a
Add tests for Netatmo oauth2 api (#46375)
* Add Netatmo tests for api

* Update tests/components/netatmo/test_api.py

* Update .coveragerc

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-03-18 14:55:39 +01:00
Kevin Worrel
d21d9951ba
Add Pentair ScreenLogic integration (#47933)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-03-16 13:32:02 -10:00
Franck Nijhof
059e9e8307
Add config flow to Verisure (#47880)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-03-15 12:30:44 -07:00
Andre Lengwenus
50b7b1cc7a
Migrate LCN configuration to ConfigEntry (Part 1) (#44090) 2021-03-15 13:45:13 +01:00
Tobias Sauerwein
6b98583bc1
Add tests for Netatmo climate (#46392)
* Add tests for Netatmo climate

* Add comments and fake webhook events

* Split tests

* Split tests

* Clean up

* Fix coveragerc

* Fix requirements

* Remove freezegun dependency

* Move async_block_till_done to

* Call async_handle_webhook directly

* Use async_handle_webhook directly p2

* Exclude helper.py from

* Remove assertion of implementation details

* Use the webhook integration handler

* Extract function
2021-03-15 12:45:36 +01:00
Khole
cfeb8eb06a
Add Hive config flow (#47300)
* Add Hive UI

* Fix tests and review updates

* Slimmed down config_flow

* Fix tests

* Updated Services.yaml with extra ui attributes

* cleanup config flow

* Update config entry

* Remove ATTR_AVAILABLE

* Fix Re-Auth  Test

* Added more tests.

* Update tests
2021-03-15 12:27:10 +01:00
J. Nick Koston
a060acc2b1
Fix recorder with MSSQL (#46678)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-03-09 11:16:19 -10:00
Marc Mueller
0c61cb555c
Add TYPE_CHECKING to coverage excludes (#47668) 2021-03-09 14:57:44 +01:00
Joakim Plate
7626aa5c94
Philips JS correct post review comments (#47247) 2021-03-03 18:51:58 +01:00
Quentame
6b9abfc2c6
Add init test to Freebox (#46998)
* Add init test to Freebox

* Review : more readable conftest

* Expect 2 blank lines between defs

* Review : Not I/O in the event loop

* Fix test_setup test

* remove useless const

* Review : mock setup methods

* Add service test

* Add import test
2021-03-02 13:37:33 +01:00
Raman Gupta
0592309b65
Add hassio addon_update service and hassio config entry with addon and OS devices and entities (#46342)
* add addon_update service, use config flow to set up config entry, create disabled sensors

* move most of entity logic to common entity class, improve device info, get rid of config_flow user step

* fix setup logic

* additional refactor

* fix refactored logic

* fix config flow tests

* add test for addon_update service and get_addons_info

* add entry setup and unload test and fix update coordinator

* handle if entry setup calls unload

* return nothing for coordinator if entry is being reloaded because coordinator will get recreated anyway

* remove entry when HA instance is no longer hassio and add corresponding test

* handle adding and removing device registry entries

* better config entry reload logic

* fix comment

* bugfix

* fix flake error

* switch pass to return

* use repository attribute for model and fallback to url

* use custom 'system' source since hassio source is misleading

* Update homeassistant/components/hassio/entity.py

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

* update remove addons function name

* Update homeassistant/components/hassio/__init__.py

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

* fix import

* pop coordinator after unload

* additional fixes

* always pass in sensor name when creating entity

* prefix one more function with async and fix tests

* use supervisor info for addons since list is already filtered on what's installed

* remove unused service

* update sensor names

* remove added handler function

* use walrus

* add OS device and sensors

* fix

* re-add addon_update service schema

* add more test coverage and exclude entities from tests

* check if instance is using hass OS in order to create OS entities

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-03-01 09:41:04 +01:00
Nathan Tilley
8d2606134d
Add FAA Delays Integration (#41347)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-24 14:11:20 -06:00
MeIchthys
1a73cb4791
Mullvad VPN (#44189)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-02-24 12:04:38 +01:00
Raman Gupta
eccdae60bf
Add ClimaCell weather integration (#36547)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-24 09:34:27 +01:00
Austin Mroczek
e5aef45bd7
Add usercode support to totalconnect (#39199)
* Add test for invalid usercode

* Add usercodes to totalconnect.

* Update existing tests for usercodes

* Fix tests

* Add test for invalid usercode

* Add usercodes to totalconnect.

* Update existing tests for usercodes

* Fix tests

* Remove YAML support

* Fix conflict

* Bump to total_connect_client 0.56

* Change Exception to HomeAssistantError

* Fix config_flow.py

* Simplify async_setup since no yaml

* Remove import from config flow and tests

* Add reauth and test for it.  Various other fixes.

* Fix pylint in __init__

* Show config yaml as deprecated

* separate config_flow and init tests

* Assert ENTRY_STATE_SETUP_ERROR in init test

* Add test for reauth flow

* Fix reauth and tests

* Fix strings

* Restore username and usercode with new passord

* Correct the integration name

* Update tests/components/totalconnect/test_config_flow.py

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

* Update tests/components/totalconnect/test_init.py

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

* Update .coveragerc

* Add test for invalid auth during reauth

* Bump total-connect-client to 0.57

* Fix .coveragerc

* More tests for usercodes

* Fix usercode test

* Reload config entry on reauth

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-22 10:39:10 +01:00
Jonathan Keslin
b6b1e725c7
Add support for VeSync dimmer switches (#44713)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-02-21 19:16:13 -10:00
Milan Meulemans
4af619d383
Add Rituals Perfume Genie integration (#46218)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-02-20 11:55:23 -10:00
Ilja Leiko
8c72cb6163
Add sensors to fetch Habitica tasks (#38910)
* Adding sensors to fetch habitica tasks

* PR changes and rebase

* Fixing pylint

* Fixing failed test dependancy

* Generating requirements

* Apply suggestions from code review

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

* PR changes

* Update homeassistant/components/habitica/config_flow.py

Thank you, @MartinHjelmare

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

* PR Changes

* Fix failing test

* Update tests/components/habitica/test_config_flow.py

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

* Fixing linting and imports

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-17 09:04:11 +01:00
ollo69
3c26235e78
Bump tuyaha to 0.0.10 and fix set temperature issues (#45732) 2021-02-15 16:20:45 -10:00
starkillerOG
2f9fda73f4
Add config flow to Xiaomi Miio switch (#46179) 2021-02-15 20:11:27 +01:00
Andrey Kupreychik
accba85e35
Add keenetic_ndms2 config flow (#38353) 2021-02-14 13:09:19 +01:00
Álvaro Fernández Rojas
eecf07d7df
Add AEMET OpenData integration (#45074)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-13 21:53:28 +01:00
ollo69
f38b06ed6d
Add Asuswrt Config Flow and Scanner Entities (#46468)
* Add Asuswrt config flow (#43948)

* Add AsusWrt Scanner Entity (#44759)

* Add Scanner Entity

- device tracker entity changed from "DeviceScanner" to "ScannerEntity"
- sensors recoded to use "router" class
- config entry review to allow multiple entity (for future use)

* Force checks

* Removed new option and change sensors

* Update test_sensor.py

* Requested changes

* Removed router unique-id

* Update last_activity attr only when available

* Add Options for AsusWRT Scanner Entity (#44808)

* Add Asuswrt config flow (#43948)

* Add AsusWrt Scanner Entity (#44759)

* Add Scanner Entity

- device tracker entity changed from "DeviceScanner" to "ScannerEntity"
- sensors recoded to use "router" class
- config entry review to allow multiple entity (for future use)

* Force checks

* Removed new option and change sensors

* Update test_sensor.py

* Requested changes

* Removed router unique-id

* Update last_activity attr only when available

* Add Options for Scanner Entity

* Fix isort

* Removed "Track New" option

* Add Options for Scanner Entity

* Fix isort

* Removed "Track New" option

* Add test for all the options in the config flow
2021-02-13 19:17:06 +01:00
Shay Levy
6f261a09b0
Remove deprecated xfinity integration (#46484) 2021-02-13 14:07:55 +01:00
Shay Levy
52c5bc0a99
Remove deprecated Synology integration (#46482) 2021-02-13 13:23:40 +01:00
jan iversen
8418489345
Allow Modbus "old" config or discovery_info as configuration (#46445) 2021-02-12 16:33:18 +01:00
Joakim Plate
8dc06e612f
Add config flow to philips_js (#45784)
* Add config flow to philips_js

* Adjust name of entry to contain serial

* Use device id in event rather than entity id

* Adjust turn on text

* Deprecate all fields

* Be somewhat more explicit in typing

* Switch to direct coordinator access

* Refactor the pluggable action

* Adjust tests a bit

* Minor adjustment

* More adjustments

* Add missing await in update coordinator

* Be more lenient to lack of system info

* Use constant for trigger type and simplify

* Apply suggestions from code review

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

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-02-11 21:37:53 +01:00
Franck Nijhof
b7e11347d5
Remove defunct Crime Reports integration (#46312) 2021-02-10 14:56:54 +01:00
djtimca
f2d9e6f70c
Add sensor platform for Aurora integration (#43148)
* Removed pylint disable on unused after updating CI files that were out of date.
* Pylint still fails due to bug on DOMAIN import. Added disable check.
* Addressed PR comments
* Added import for ClientError to test_config_flow.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-02-05 23:05:39 -08:00
functionpointer
c01e01f797
MySensors config flow (#45421)
* MySensors: Add type annotations

Adds a bunch of type annotations that were created
while understanding the code.

* MySensors: Change GatewayId to string

In preparation for config flow.
The GatewayId used to be id(gateway).

With config flows, every gateway will have its own
ConfigEntry. Every ConfigEntry has a unique id.
Thus we would have two separate but one-to-one related ID systems.

This commit removes this unneeded duplication by using the id of the ConfigEntry
as GatewayId.

* MySensors: Add unique_id to all entities

This allows entities to work well with the frontend.

* MySensors: Add device_info to all entities

Entities belonging to the same node_id will now by grouped as a device.

* MySensors: clean up device.py a bit

* MySensors: Add config flow support

With this change the MySensors can be fully configured from the GUI.

Legacy configuration.yaml configs will be migrated by reading them once.
Note that custom node names are not migrated. Users will have to re-enter
the names in the front-end.
Since there is no straight-forward way to configure global settings,
all previously global settings are now per-gateway. These settings include:
- MQTT retain
- optimistic
- persistence enable
- MySensors version

When a MySensors integration is loaded, it works as follows:
1. __init__.async_setup_entry is called
2. for every platform, async_forward_entry_setup is called
3. the platform's async_setup_entry is called
4. __init__.setup_mysensors_platform is called
5. the entity's constructor (e.g. MySensorsCover) is called
6. the created entity is stored in a dict in the hass object

* MySensors: Fix linter errors

* MySensors: Remove unused import

* MySensors: Feedback from @MartinHjelmare

* MySensors: Multi-step config flow

* MySensors: More feedback

* MySensors: Move all storage in hass object under DOMAIN

The integration now stores everything under hass.data["mysensors"]
instead of using several top level keys.

* MySensors: await shutdown of gateway instead of creating a task

* MySensors: Rename Ethernet to TCP

* MySensors: Absolute imports and cosmetic changes

* MySensors: fix gw_stop

* MySensors: Allow user to specify persistence file

* MySensors: Nicer log message

* MySensors: Add lots of unit tests

* MySensors: Fix legacy import of persistence file name

Turns out tests help to find bugs :D

* MySensors: Improve test coverage

* MySensors: Use json persistence files by default

* MySensors: Code style improvements

* MySensors: Stop adding attributes to existing objects

This commit removes the extra attributes that were being
added to the gateway objects from pymysensors.

Most attributes were easy to remove, except for the gateway id.
The MySensorsDevice class needs the gateway id as it is part of its DevId
as well as the unique_id and device_info.
Most MySensorsDevices actually end up being Entities.
Entities have access to their ConfigEntry via self.platform.config_entry.

However, the device_tracker platform does not become an Entity.
For this reason, the gateway id is not fetched from self.plaform but
given as an argument.

Additionally, MySensorsDevices expose the address of the gateway
(CONF_DEVICE). Entities can easily fetch this information via self.platform,
but the device_tracker cannot. This commit chooses to remove the gateway
address from device_tracker. While this could in theory break some automations,
the simplicity of this solution was deemed worth it.
The alternative of adding the entire ConfigEntry as an argument to MySensorsDevices
is not viable, because device_tracker is initialized by the async_setup_scanner function
that isn't supplied a ConfigEntry. It only gets discovery_info.
Adding the entire ConfigEntry doesn't seem appropriate for this edge case.

* MySensors: Fix gw_stop and the translations

* MySensors: Fix incorrect function calls

* MySensors: Fewer comments in const.py

* MySensors: Remove union from _get_gateway and remove id from try_connect

* MySensors: Deprecate nodes option in configuration.yaml

* MySensors: Use version parser from packaging

* MySensors: Remove prefix from unique_id and change some private property names

* MySensors: Change _get_gateway function signature

* MySensors: add packaging==20.8 for the version parser

* MySensors: Rename some stuff

* MySensors: use pytest.mark.parametrize

* MySensors: Clean up test cases

* MySensors: Remove unneeded parameter from devices

* Revert "MySensors: add packaging==20.8 for the version parser"

This reverts commit 6b200ee01a.

* MySensors: Use core interface for testing configuration.yaml import

* MySensors: Fix test_init

* MySensors: Rename a few variables

* MySensors: cosmetic changes

* MySensors: Update strings.json

* MySensors: Still more feedback from @MartinHjelmare

* MySensors: Remove unused strings

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

* MySensors: Fix typo and remove another unused string

* MySensors: More strings.json

* MySensors: Fix gateway ready handler

* MySensors: Add duplicate detection to config flows

* MySensors: Deal with non-existing topics and ports.

Includes unit tests for these cases.

* MySensors: Use awesomeversion instead of packaging

* Add string already_configured

* MySensors: Abort config flow when config is found to be invalid while importing

* MySensors: Copy all error messages to also be abort messages

All error strings may now also be used as an abort reason,
so the strings should be defined

* Use string references

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-05 22:13:57 +01:00
Aidan Timson
3a77ef02e4
Add sensors to Lyric integration (#45791)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-02-01 15:51:20 -10:00
Johan Nenzén
285bd3aa91
Add support for Keg and Airlock to Plaato using polling API (#34760)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-02-01 07:12:56 -10:00
Tobias Bielohlawek
6e67b943da
Remove Nuimo integration (#45600) 2021-02-01 16:58:00 +01:00
Aidan Timson
2d10c83150
Honeywell Lyric Integration (#39695)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-01-31 07:51:31 -10:00
Pascal Reeb
ba55f1ff4b
Add config flow for nuki (#45664)
* implemented config_flow for nuki component

* warn -> warning

* exception handling & config_flow tests

* gen_requirements_all

* Update config_flow.py

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-01-29 11:05:13 +01:00
Guido Schmitz
8065ece0bd
Add first set of tests to devolo Home Control integration (#42527)
* Add first two testcases

* Remove repetition

* Add first two testcases

* Remove repetition

* Add connection error test case

* add test_setup_entry_credentials_valid

* First attempt to use fixtures

* Use markers

* Optimize patch

* Optimize marker use

* Always patch mydevolo

* Add first two testcases

* Remove repetition

* Add first two testcases

* Remove repetition

* Add connection error test case

* add test_setup_entry_credentials_valid

* First attempt to use fixtures

* Use markers

* Optimize patch

* Optimize marker use

* Always patch mydevolo

* Add unload entry test case

* Catch up with reality

* Use unittest patch

* Use core interface to start tests

* Use entry state

* Consistently assert entry state

* Patch class instead of init

Co-authored-by: Markus Bong <2Fake1987@gmail.com>
2021-01-28 17:14:33 +01:00
springstan
566058f701
Add config flow to fritzbox_callmonitor (#40736) 2021-01-27 16:53:45 +01:00
Robert Chmielowiec
80c2efa9f2
Add total energy, preheater and RMOT sensors to comfoconnect (#45373) 2021-01-27 08:10:58 -05:00
William Scanlon
260d9f8e16
Upgrade econet to use new API (#44427)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-01-26 09:18:20 +01:00
Sergio Conde Gómez
83b210061d
Add config_flow and stream selection to foscam (#41429)
* Add config_flow and stream selection to foscam

* Simplify config_flow steps

* Make debug log entry more useful

* Deprecate config and platform schemas

* Simplify config loading

* Add config flow testing

* Remove unneeded CONFIG_SCHEMA deprecation

* Improve test coverage

* Unload service by tracking loaded entries

* Address comment

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-01-13 16:09:05 +01:00
Martin Hjelmare
3537a7c3d5
Correct zwave_js value changed callback signature (#45110) 2021-01-13 15:31:31 +01:00
Shay Levy
e3f38942cc
Add 100% tests coverage for Shelly cover and switch platforms (#45001) 2021-01-11 16:45:06 +01:00
Martin Hjelmare
d270f9515b
Add zwave_js init module tests (#45048)
* Add entry setup and unload test

* Test home assistant stop

* Test on connect and on disconnect

* Test client connect timeout

* Test ready node added

* Test non ready node added

* Test existing node not ready

* Test device registry state

* Add common test tools module

* Add existing ready node test

* Include init module in coverage calculation

* Clean docstrings
2021-01-11 16:05:11 +01:00
Charles Garwood
d68fdbc283
Add zwave_js integration (#45020)
* Run zwave_js scaffold (#44891)

* Add zwave_js basic connection to zwave server (#44904)

* add the basic connection to zwave server

* fix name

* Fix requirements

* Fix things

* Version bump dep to 0.1.2

* fix pylint

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Bump zwave-js-server-python to 0.2.0

* Use zwave js server version check instead of fetching full state (#44943)

* Use version check instead of fetching full state

* Fix tests

* Use 0.3.0

* Also catch aiohttp client errors

* Update docstring

* Lint

* Unignore zwave_js

* Add zwave_js entity discovery basics and sensor platform (#44927)

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

* Complete zwave_js typing (#44960)

* Type discovery

* Type init

* Type entity

* Type config flow

* Type sensor

* Require typing of zwave_js

* Complete zwave_js config flow test coverage (#44955)

* Correct zwave_js sensor device class (#44968)

* Fix zwave_js KeyError on entry setup timeout (#44966)

* Bump zwave-js-server-python to 0.5.0 (#44975)

* Remove stale callback signal from zwave_js (#44994)

* Add light platform to zwave_js integration (#44974)

* add light platform

* styling fix

* fix type hint

* Fix typing

* Update homeassistant/components/zwave_js/const.py

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

* Update homeassistant/components/zwave_js/entity.py

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

* Update homeassistant/components/zwave_js/entity.py

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

* Update homeassistant/components/zwave_js/entity.py

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

* Update homeassistant/components/zwave_js/entity.py

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

* Update homeassistant/components/zwave_js/entity.py

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

* color temp should be integer

* guard Nonetype error

* Update homeassistant/components/zwave_js/light.py

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

* Update homeassistant/components/zwave_js/light.py

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

* some fixes after merging

* add additional guards for None values

* adjustments for rgb lights

* Fix typing

* Fix black

* Bump zwave-js-server-python to 0.6.0

* guard value updated log

* remove value_id lookup as its no longer needed

* fiz sending white value

* Update homeassistant/components/zwave_js/light.py

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

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

* Add zwave_js test foundation (#44983)

* Exclude text files from codespell

* Add basic dump fixture

* Add test foundation

* Fix test after rebase

* Exclude jsonl files from codespell

* Rename fixture file type to jsonl

* Update fixture path

* Fix stale docstring

* Add controller state json fixture

* Add multisensor 6 state json fixture

* Update fixtures

* Remove basic dump fixture

* Fix fixtures after library bump

* Update codeowner

* Minor cleanup Z-Wave JS (#45021)

* Update zwave_js device_info (#45023)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-01-11 00:08:25 +01:00
J. Nick Koston
4b54694c5c
Add config flow for somfy_mylink (#44977)
* Add config flow for somfy_mylink

* fix typo
2021-01-10 20:24:22 +01:00
jjlawren
0426b211f6
Rewrite Plex tests to use mocked payloads (#44044) 2021-01-07 19:56:52 +01:00
Mike Keesey
60a1948ab0
Generate switches for harmony activities automatically (#42331)
* Adding switch code for harmony activities

* Working on-off

* Removing poll code for now

* Async updates for current activity

* Update our state based on events

* Notifications we got connected or disconnected

* Remove unncessary constructor arg

* Initial switch tests

* Additional tests for switch transitions

* Test transitions for availability

* Testing switch state changes

* Tests passing

* Final tests

* Updating manifest.

* Correctly mock the return value from a call to the library

* Adding new subscriber classes

* Update class name and location

* Got the refactor working locally.

* Tests passing

* Tracking state changes

* Remove write_to_config_file - this appears to never be read.

It was added far back in the past to account for a harmony library
change, but nothing ever reads that path.

Removing that side effect from tests is a pain - avoid the side effect
completely.

* Connection changes tested

* Clean up temporary code

* Update .coveragerc for harmony component

Specifically exclude untested files instead of the whole module

* Fix linting

* test sending activity change commands by id

* Improving coverage

* Testing channel change commands

* Splitting subscriber logic into it's own class

* Improve coverage and tighten up .coveragerc

* Test cleanups.

* re-add config file writing for harmony remote

* Create fixture for the mock harmonyclient

* Reduce duplication in subscription callbacks

* use async_run_job to call callbacks

* Adding some tests for async behaviors with subscribers.

* async_call_later for delay in marking remote unavailable

* Test disconnection handling in harmony remote

* Early exit if activity not specified

* Use connection state mixin

* Lint fix after rebase

* Fix isort

* super init for ConnectionStateMixin

* Adding @mkeesey to harmony CODEOWNERS
2021-01-04 13:21:14 -10:00
JeromeHXP
de780c6d35
Add Ondilo ico integration (#44728)
* First implementationof Ondilo component support

* Update manifest toadd pypi pkg dependency

* Update entities name and corrected refresh issue

* Changed percentage unit name

* Corrected merge issues

* Updated coveragerc

* cleaned up code and corrected config flow tests

* Code cleanup and added test for exisitng entry

* Changes following PR comments:
- Inherit CoordinatorEntity instead of Entity
- Merged pools blocking calls into one
- Renamed devices vars to sensors
- Check supported sensor types
- Stop relying on array index position for pools
- Stop relying on attribute position in dict for sensors

* Corrected unit test

* Reformat sensor type check
2021-01-04 08:09:01 -08:00
Allen Porter
321c0a87ae
Resolve nest pub/sub subscriber token refresh issues (#44686) 2021-01-02 01:51:01 +01:00
Franck Nijhof
508d33a220
Remove deprecated PTVSD integration (#44748) 2021-01-01 23:36:15 +01:00
Allen Porter
051f6c0e72
Increase test coverage for Nest SDM integration (#44718) 2021-01-01 13:31:18 +01:00
J.P. Krauss
e37bb51320
Add AirNow Integration (#40091) 2020-12-30 20:25:57 +01:00
rikroe
e5f31665b1
Add Config Flow to bmw_connected_drive (#39585)
* Add Config Flow to bmw_connected_drive

* Fix checks for bmw_connected_drive

* Adjust code as requested

* Clean .coveragerc after merge

* Use references for config flow

* Fix execute_service check against allowed accounts

* Adjust translation as username can be email or phone no

* Add BMWConnectedDriveBaseEntity mixin, remove unnecessary type casts

* Use BaseEntity correctly, fix pylint error

* Bump bimmer_connected to 0.7.13

* Adjustments for review

* Fix pylint

* Fix loading notify, move vin to entity attrs

* Remove vin from device registry

* Remove commented-out code

* Show tracker warning only if vehicle (currently) doesn't support location

* Remove unnecessary return values & other small adjustments

* Move original hass_config to own domain in hass.data

* Move entries to separate dict in hass.data

* Remove invalid_auth exception handling & test as it cannot happen

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2020-12-29 11:06:12 +01:00
badguy99
d95696e4f5
Soma cover battery level attribute (#44459) 2020-12-28 17:10:49 +01:00
Tim van Cann
1f27fb4644
Fully remove Avri integration (#44478)
* Fully remove Avri integration

* Remove avri from .coveragerc
2020-12-27 09:30:20 +01:00
Allen Porter
24ccdb55bb
Move Legacy Works With Nest integration to subdirectory (#44368)
* Move Legacy Works With Nest integration to subdirectory

Motivation is to streamline the actively developed integration e.g. make code coverage easier to reason about and simplify __init__.py
2020-12-22 12:42:37 -08:00
Santobert
d0ebc00684
Add OAuth to Neato (#44031)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-12-16 23:39:41 +01:00
Allen Porter
1a8123aba6
Increase nest climate test coverage (#44146) 2020-12-12 20:57:02 +01:00
Allen Porter
6d12e764b7
Increase test coverage for nest camera (#44144) 2020-12-12 10:17:43 +01:00
Eric Severance
b4afef1395
Add tests for the wemo component (#44088)
* Add tests for the wemo component.

* Prefer mock tools from tests.async_mock over importing asynctest directly

* Avoid using `entity/entities` except when referring to an `Entity` instance in wemo tests

* Remove the overridden event_loop fixture from the wemo tests

* Patch the library code, not the integration code, in the wemo tests
2020-12-10 22:24:26 +01:00
Dermot Duffy
b9a3a001fb
Include Hyperion in coverage testing (#44096) 2020-12-10 09:41:11 +01:00
Vladimír Záhradník
d518db1c95
Improve custom datatype parsing in Modbus sensor and climate (#42354) 2020-12-02 21:16:30 +01:00
jjlawren
f2f935506e
Use Plex websocket payloads to reduce overhead (#42332)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-12-02 19:00:13 +01:00
Pierre Ståhl
edb246d696
Refactor Apple TV integration (#31952)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-12-02 17:01:55 +01:00
Paulus Schoutsen
7d23ff6511
Add device action to mobile app to notify (#43814) 2020-12-01 18:14:01 +01:00
Franck Nijhof
24ba5bcbaf
Remove Ubee Router integration (ADR-0004) (#43809) 2020-12-01 17:06:49 +01:00
Allen Porter
945a0a9f7e
Add nest device triggers for camera and doorbell events (#43548) 2020-11-30 09:19:42 +01:00
Ron Klinkien
2c6a72b3ad
Add Response switch platform to FireServiceRota integration (#43700)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-11-28 21:42:51 +01:00
Franck Nijhof
0d5dc4aeee
Add system health check to Spotify (#43249) 2020-11-27 19:25:17 +01:00
Ron Klinkien
316a2750df
Add Duty binary_sensor platform to FireServiceRota integration (#43638) 2020-11-26 15:42:55 +01:00
Ron Klinkien
ea52ffc2d9
Add FireServiceRota/BrandweerRooster integration (#38206)
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-11-25 16:38:49 +01:00
starkillerOG
0c30abda61
Add Motion Blinds integration (#42989)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-11-23 10:33:14 -10:00
Alexei Chetroi
e32669a2d9
Remove zigpy monkey patching (#43456)
* Use event handler for incoming messages from zigpy

* Bump up zha dependency
2020-11-20 20:02:52 -05:00
Martin Hjelmare
22f63be30e
Remove salt integration for webscraping (#43452) 2020-11-20 21:48:23 +01:00
Aaron Bach
24840cce23
Add a config flow for Recollect Waste (#43063)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-11-12 11:00:42 +01:00
djtimca
d47b3a5f44
Fix Aurora integration including externalizing API to PyPi and adding config_flow (#43045)
Co-authored-by: Pawel <pszafer@gmail.com>
2020-11-11 20:36:16 +01:00