Commit Graph

1555 Commits

Author SHA1 Message Date
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
Franck Nijhof 3380b69d54
Remove iAlarm integration (ADR-0004) (#43010) 2020-11-09 18:35:09 +01:00
Simone Chemelli 05dc457955
Handle Shelly light domain for relay switches ( fw >=1.9 ) (#42508)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-11-05 18:38:53 +01:00
Joakim Sørensen a199d7af59
Move to Launch Library 2 (#42723)
* Move to Launch Library 2

* isort

* Apply suggestions from code review

* Add const to .coveragerc
2020-11-05 15:42:12 +01:00
Niccolo Zapponi 5ddf99e496
Add support for OpenWeatherMap One Call API (#39839) 2020-11-03 08:37:30 -10:00
Schachar Levin af048715f0
Add next alarm time sensor to Garmin (#40420)
* Add sensor for garmin next alarm(s)

* code-review changes

* type fix

* linter fix

* review fixes
2020-10-23 23:01:29 +02:00
Erik Montnemery b626df1316
Improve cast integration tests (#42229)
* Improve cast tests

* Address review comments

* Further cleanup of tests
2020-10-23 16:16:55 +02:00
Greg Dowling 9a54c31c34
Add media browser support to roon media player (#42061) 2020-10-22 14:54:55 +02:00
Chris Talkington d8577a1550
Add config flow for cloudflare (#41167)
* add config flow for cloudflare

* Create const.py

* work on flow.

* remove const.

* lint.

* Apply suggestions from code review

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

* Update config_flows.py

* Update homeassistant/components/cloudflare/strings.json

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update strings.json

* Apply suggestions from code review

* Update __init__.py

* Update __init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-10-21 09:09:00 -05:00
rajlaud fcdb54d878
Add browse media support to squeezebox integration (#40642)
* Add browse media support to squeezebox integration

* Move browse media logic to browse_media.py

* Fix missing command when loading single url

* Update .coveragerc

* Handle empty library gracefully

* Apply suggestions from code review

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

* Implement suggestions from code review

* Additional suggestion from code review

* Use MEDIA_CLASS_GENRE

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-20 01:17:00 -05:00
Paulus Schoutsen 39ba0fc7ee
Remove BOM integration because it uses webscraping (#41941)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-17 13:56:11 +02:00
J. Nick Koston ad6ce5fa83
Convert rest sensors to async using httpx (#41973) 2020-10-16 19:21:13 -05:00
Paulus Schoutsen 2f69b53bc3
Fix upcloud coverage that is breaking CI (#41934) 2020-10-16 11:30:51 +02:00
Jason Hunter c10fe4f723
Add sensors to Xbox integration (#41868)
* favorited friends binary sensors

* add binary_sensor to .coveragerc

* fix copy/paste comments...

* make sensor entities instead of attributes

* address PR review comments

* default state to None
2020-10-15 19:11:05 -04:00
On Freund 086378c48f
Add media browser capability to volumio (#40785) 2020-10-15 15:49:36 +02:00
Jason Hunter 2b1fc90de7
Add Media Source to Xbox Integration (#41833)
* initial implementation of xbox media source

* minor fixes

* fix lint

* add media class map to remove multi-line ternary
2020-10-14 15:02:08 -04:00
epenet 3cba25a892
Add test coverage for onewire (#40786)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-14 10:19:12 +02:00
Jason Hunter 3013f39191
Add Remote entity to Xbox Integration (#41809) 2020-10-13 21:00:44 -04:00
Jason Hunter c3ccea52a5
Add Browse Media to Xbox (#41776)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-13 17:51:51 +02:00
Jason Hunter 9877e8e25b
Add Xbox Integration (#41697)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-13 15:37:01 +02:00
Niccolo Zapponi 8a45bc2d13
Add support for SimpliSafe sensors (#41080)
* Add support for SimpliSafe sensors

* Turn sensor refresh rate to a configurable setting

* Set minimum to scan interval

* Removed dynamic sensor refresh rate

* Refactoring

* Refactoring

* Move battery entities to binary_sensor platform

* Bug fix

* Clean up

* Simplified device info override

* Ignore sensor cache
2020-10-12 11:31:55 -06:00
Angelo Gagliano 874e1f6103
Prevent tplink missing devices and unavailable state (#39762)
* Adds self to codeowners for tplink

* Adds retry to update to prevent missing devices

* Runs through isort and corrects async commit

* Runs through black

* Runs through pre-checks

* Corrects and matches var names

* Re-runs through black

* Corrects var name

* Removes the retry loop and in favor of async add

* Cleanup imports

* Removes no longer valid test

* Removes is_ready and only log retry once

* Corrects switch logging vars

* Adds list of entities to add_entities

* Consumes exception for attempt_update

* Consumes specific exception

* Removes unnecessary update

* Reducing back to 2 seconds

* Removes useless return

* Call get_sysinfo for all at once

* Formated black

* Adds missing docstirng

* Corrects docstring

* Update homeassistant/components/tplink/light.py

Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>

* Corrects sysinfo call

* Adds default for host vars

* Adds log when device responds again

* Revert host alias default

* Removes unncessary host var

* Removes host var

* Get device details from sysinfo

* Use host and alias for log msg

* Gets hosts from smartbulb

* Changes retry logging to debug

* Attempts coverage add

* Removes unused import

* Updates tests for new retry

* Runs through isort

* Removes unneeded try

* Prevents static entries from failing integration

* Format black

* Forces an update after turn on off

* Remove common test

* Revert update after turn_on off

* Adds patch for sleep_time 0

* Returns False when update fails

Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-10-11 21:10:36 +02:00
Martin Hjelmare e006e0ddb3
Revert zoneminder config flow (#41395) 2020-10-07 16:28:49 +02:00
Raman Gupta 6db4075a23
Add OZW node config parameters websocket commands (#40527)
* add websocket commands to retrieve and set config parameters for a node

* move set_config_parameter into generic function and refactor service and WS API

* add payload to return to make service call behave the same way it did before

* create response class

* update error message to pass tests

* move things a bit to reduce LOC

* add tests

* handle logging errors better and make new response class more generic to prepare for lock user code work

* remove unused function parameter

* invert check

* add additional error checking

* refactor a bit to remove repeat code

* revert log msg change

* one more refactor to create generic get_config_parameters function

* change if logic for consistency

* fix test

* add support to provide bool value in set_config_parameter service call

* standardize parameter names on service call

* add test coverage

* fix tests and message sending

* remove unnecessary logging import

* fix one test to get missing coverage

* update per martin and kpines reviews

* remove false assertion

* string line length

* add support for Decimal config param, remove node instance ID as input, and move helper functions to node.py

* cast Decimal appropriately

* revert change to support Decimal for config params since they are not supported as a config param type

* revert to using error arguments to make next PR for WS lock commands easier

* switch to class method and add guard for list Value not being a number

* update logic to use new openzwavemqtt util methods

* add support for bitsets

* use parent exception class

* bump openzwavemqtt version, remove node.py from .coveragerc and put file references in the right place

* add comment

* improve config validation

* remove bitset support from config validation

* re-add bitset support with some additional tests

* move send_result out of try block
2020-10-05 21:47:28 +02:00
Daniel Hjelseth Høyer 9bdc716e60
Include config flow modules in coverage (#40798)
* update coveragerc

* typo
2020-09-30 19:55:26 +02:00
Quentame 1d816d25f7
Add Surveillance Station home mode switch for Synology DSM (#40490)
* Use camera name as device name

* Add Surveillance Station home mode switch for Synology DSM

- camera uses Surveillance Station as device parent
- camera uses camera name instead of NAS name + camera name

* Without device_class otherwise no icon

* Update .coveragerc
2020-09-30 18:27:06 +02:00
jan iversen 0ca19133d9
Add tests for modbus binary sensor (#40367)
* Add test coverage of binary sensor.

Update conftest to be generic.

* Pass total config structure to run_base_test.

Simple devices like sensor/switch do only have one entry in the
dict array, whereas e.g. switch have multiple entries.

* Use STATE_ON / _OFF for binary_sensor test.

* Update coveragerc

Only exclude files that uses a third party library.

* Remove modbus/* from coveragerc

* Remove modbus from .coveragerc

* Update .coveragerc

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-09-27 20:00:44 -05:00
epenet f886ea9e3d
Move onewire constants to separate file (#40550)
* Move constants to separate file

* Ignore coverage of const.py
2020-09-27 19:02:20 -05:00
tkdrob 67a7b28c84
Add Integration for Goal Zero Yeti Power Stations (#39231)
* Add Integration for Goal Zero Yeti Power Stations

* Goal Zero Yeti integration with config flow

* Remove unused entities

* Remove entry from requirements_test_all

* Pylint fix

* Apply suggestions from code review

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

* Add tests for goalzero integration

* Fix UNIT_PERCENTAGE to PERCENTAGE

* isort PERCENTAGE

* Add tests

* Add en translation

* Fix tests

* bump goalzero to 0.1.1

* fix await

* bump goalzero to 0.1.2

* Update tests/components/goalzero/__init__.py

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

* apply recommended changes

* isort

* bump goalzero to 0.1.4

* apply recommended changes

* apply recommended changes

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-27 12:44:21 -05:00
Oliver Acevedo 0c12af347e
Add Omnilogic integration (#40474)
* Scaffold

* Added the en translation

* Modified the name

* Basic functionality for config flow.

* Pulled in enough to validate config flow works.

* Update manifest.json

* initial data polling (water and air temp sensors)

* Adding sensors, debugging update function

* polling updates working

* support for new data format from library

* Updated entity_id, friendly name, conversion for ppm, attributes for hayward display units, MSPSystemID and component systemID

* Fixed errors for PR

* clean up

* Add login exc, check if configured, test login.

* Remove debug print.

* Black formatting, ran isort, update requirements.

* Updated w isort. fix flake8 failures.

* Fix flake8 errors

* Fixed self.attrs to remove invalid self._ values - small change

* Missed on small change - fixing attributes

* Updated naming, updated unit of measure, updated icon, bumped omnilog…

* Updated to fix flake8 issues in __init__.py and config_flow.py

* Updated test_config_flow.py to pass, updated config_flow.py to correct errors in test

* Remove comments in preparation for PR

* update .covezragerc

* Formatting fix

* Rewrote sensors to dynamically add all BOWs, pumps, clorinators. Still to do - add CSAD sensors.

* Rewrote sensors to dynamically add all BOWs, pumps, clorinators. Still to do - add CSAD sensors.

* Added CSAD sensors for pools that have them.

* Added CSAD sensors for pools that have them.

* Fixed CSAD to not create if blank or don't exist, removed broad except usage to pass linting.

* Updated entity naming convention. Fixed linting issues.

* Added device association to the back yard / omnilogic system

* Removed .0 from ppm values when returning imperial values for salt sensor

* Updated to return state = None for water temp when pump is off, handled Chlorinator operatingMode = 2, and added PlatformNotReady check

* Corrected exception from Omnilogic library

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Removed nested_lookup dependency, bumped omnilogic.py to 0.3.8.

* Fixed lint error

* Added logging for sensor creation.

* Fixed linting errors with logging.

* Fixed explicit chaining of raised error. Fixed issue with alarm sensor.

* Fixed manifest.json based on feedback.

* Fixed self.attrs, should_poll, CoordinatorEntity, SCAN_INTERVAL from comments in PR.

* Addressed unique_id, moved data update coordinator, addressed minor other issues from testing

* Created main OmniLogic entity for common items, reworked DataUpdateCoordinator to it's own class.

* Addressed config_schema not used in __init__.py

* Fixed linting issues.

* Addressed several comments, still todo - separate sensor classes.

* Split the Omnilogic Sensors into separate logical classes for simpler logic.

* Fixed snake case lint error for AddAlarms (to add_alarms)

* Addressed config_flow issues from comments.

* Changed addressed ConfigNotReady issue from comments.

* Updated strings.json and generated corrected en.json with translations.

* Updated en.json to standard generated file.

* Added config_flow tests and updated issue with config_flow on cannot_connect

* Added test case for incomplete information entered.

* Compressed logic in the sensor classes to reduce duplication.

* Updated strings.json for polling_interval, added generic exception handling on config flow.

* Removed omnilogic from the .coveragerc omit file.

* Updated test_config_flow to follow recommended pattern.

* Excluded sensor.py from test coverage tests.

* Corected minor issues in test_config_flow from comments

* Fixed linting issues on last commits

* Fixed linting issues.

* Corrected issue when temp state is not available from Omnilogic

* Added omnililogic_common.py from .coveragerc to bypass test coverage check.

* Return false on Login Exception, handle OmniLogicException in config_flow and in tests.

* Handle all exceptions and in config_flow and tests, clarified test naming.

* Broke out test cases per comments.

* Regenerated en.json file.

* Addressed changes from comments in PR.

* Added session and bumped API to 0.4.0, addressed other comments from PR.

* Addressed entitydata (missed earlier).

* Fixed pylint issue

* Added test case for options flow in test_config_flow.py

* Removed super() and used self when calling methods in current class.

* Addressed comments in PR.

* Addressed comments in PR.

* Updated translations file.

* Rewrote data coordinator to output dict for easy searching.

* Updated chlorinator unit when chlorinator is on/off only

* Scaffold

* Added the en translation

* Modified the name

* Basic functionality for config flow.

* Pulled in enough to validate config flow works.

* Update manifest.json

* initial data polling (water and air temp sensors)

* Adding sensors, debugging update function

* polling updates working

* support for new data format from library

* Updated entity_id, friendly name, conversion for ppm, attributes for hayward display units, MSPSystemID and component systemID

* Fixed errors for PR

* clean up

* Add login exc, check if configured, test login.

* Remove debug print.

* Black formatting, ran isort, update requirements.

* Updated w isort. fix flake8 failures.

* Fix flake8 errors

* Fixed self.attrs to remove invalid self._ values - small change

* Missed on small change - fixing attributes

* Updated naming, updated unit of measure, updated icon, bumped omnilog…

* Updated to fix flake8 issues in __init__.py and config_flow.py

* Updated test_config_flow.py to pass, updated config_flow.py to correct errors in test

* Remove comments in preparation for PR

* update .covezragerc

* Formatting fix

* Rewrote sensors to dynamically add all BOWs, pumps, clorinators. Still to do - add CSAD sensors.

* Rewrote sensors to dynamically add all BOWs, pumps, clorinators. Still to do - add CSAD sensors.

* Added CSAD sensors for pools that have them.

* Added CSAD sensors for pools that have them.

* Fixed CSAD to not create if blank or don't exist, removed broad except usage to pass linting.

* Updated entity naming convention. Fixed linting issues.

* Added device association to the back yard / omnilogic system

* Removed .0 from ppm values when returning imperial values for salt sensor

* Updated to return state = None for water temp when pump is off, handled Chlorinator operatingMode = 2, and added PlatformNotReady check

* Corrected exception from Omnilogic library

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Removed nested_lookup dependency, bumped omnilogic.py to 0.3.8.

* Fixed lint error

* Added logging for sensor creation.

* Fixed linting errors with logging.

* Fixed explicit chaining of raised error. Fixed issue with alarm sensor.

* Fixed manifest.json based on feedback.

* Fixed self.attrs, should_poll, CoordinatorEntity, SCAN_INTERVAL from comments in PR.

* Addressed unique_id, moved data update coordinator, addressed minor other issues from testing

* Created main OmniLogic entity for common items, reworked DataUpdateCoordinator to it's own class.

* Addressed config_schema not used in __init__.py

* Fixed linting issues.

* Addressed several comments, still todo - separate sensor classes.

* Split the Omnilogic Sensors into separate logical classes for simpler logic.

* Fixed snake case lint error for AddAlarms (to add_alarms)

* Addressed config_flow issues from comments.

* Changed addressed ConfigNotReady issue from comments.

* Updated strings.json and generated corrected en.json with translations.

* Updated en.json to standard generated file.

* Added config_flow tests and updated issue with config_flow on cannot_connect

* Added test case for incomplete information entered.

* Compressed logic in the sensor classes to reduce duplication.

* Updated strings.json for polling_interval, added generic exception handling on config flow.

* Removed omnilogic from the .coveragerc omit file.

* Updated test_config_flow to follow recommended pattern.

* Excluded sensor.py from test coverage tests.

* Corected minor issues in test_config_flow from comments

* Fixed linting issues on last commits

* Fixed linting issues.

* Corrected issue when temp state is not available from Omnilogic

* Added omnililogic_common.py from .coveragerc to bypass test coverage check.

* Return false on Login Exception, handle OmniLogicException in config_flow and in tests.

* Handle all exceptions and in config_flow and tests, clarified test naming.

* Broke out test cases per comments.

* Regenerated en.json file.

* Addressed changes from comments in PR.

* Added session and bumped API to 0.4.0, addressed other comments from PR.

* Addressed entitydata (missed earlier).

* Fixed pylint issue

* Added test case for options flow in test_config_flow.py

* Removed super() and used self when calling methods in current class.

* Addressed comments in PR.

* Addressed comments in PR.

* Updated translations file.

* Rewrote data coordinator to output dict for easy searching.

* Updated chlorinator unit when chlorinator is on/off only

* Fixed ORP method not being @property, fixed unique_id potential issue. Does not address comments from PR.

* Rewrote coordinator for updated dict structure, rewrote sensors to parse new data structure.

* Added alarms as attributes on all entities which support alarm reporting.

* Updated SENSOR_TYPES to sensor_types to adhere to snake case in pylint.

* Addressed PR comments.

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/sensor.py

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

* Removed binary sensor conditions (alarms, on/off sensor types) and added ability for multiple guard conditions

* Update homeassistant/components/omnilogic/sensor.py

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

* Updated per comments in PR for Pump Type and removal of force_update().

* Update homeassistant/components/omnilogic/sensor.py

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

* Update homeassistant/components/omnilogic/common.py

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

* Correctly asserting conditions for the login exception case.

* Update .coveragerc

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

Co-authored-by: Mike Hershberger <mike.hershberger@gmail.com>
Co-authored-by: Chad <54695185+chadlyy@users.noreply.github.com>
Co-authored-by: Tim Empringham <tim.empringham@live.ca>
Co-authored-by: djtimca <60706061+djtimca@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-25 17:55:10 +02:00
Tom Schneider 6e8e4eedb5
Add binary_sensor for elevator states to hvv_departures (#36822)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-22 17:42:50 +02:00
Perry Naseck 0582bf7746
Firmata analog input, PWM/analog output, deprecate arduino (#40369)
* firmata analog input

* firmata pwm/analog out, use more HA const

* firmata update pymata to 1.19

* deprecate arduino, firmata supersedes it

* firmata sensor diff min, pull review quality changes

* firmata condense platform setup into loop
2020-09-22 09:44:16 +02:00
Brett 4f5d3b4035
Rebuilt Splunk using custom library (#40123)
* Rebuilt Splunk using splunk_data_sender

* Fixing lint issues

* Apply suggestions from code review

Recommended Fixes

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

* Moved to single send queue and fixed ssl verify

* Using coroutine and Asyncio.lock

* Changed to custom library hass_splunk

* Fixed "use_ssl" parameter

* Better error catching

* Better error log

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-20 11:22:43 +02:00
Robert Van Gorkom 70173488a8
Add config support to zoneminder integration (#37060)
* Add config support to zoneminder integration.

* Fixing spelling issue.
Adding self to maintainers.
Updating config flows generated file.

* Maintain zoneminder functionality without breaking changes.

* Addressing lint feedback.
Updating code owners.

* Using non-blocking calls.

* Adding tests package file.

* Update service description.

Co-authored-by: Rohan Kapoor <rohan@rohankapoor.com>

* Resolving conflicts in requirements file.

* Resolving more conflicts.

* Addressing PR feedback.

* Merging from dev.

Co-authored-by: Rohan Kapoor <rohan@rohankapoor.com>
2020-09-16 22:58:51 -07:00
Chris Talkington 00acb180d6
Add canary alarm_control_panel tests (#40029)
* add canary alarm_control_panel tests

* Update .coveragerc

* Create test_alarm_control_panel.py

* Update __init__.py

* Update __init__.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update __init__.py

* Update __init__.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py
2020-09-13 16:36:26 -05:00
AJ Schmidt c32f698671
Add Config Flow to AlarmDecoder (#37998) 2020-09-13 12:29:25 -05:00
Xiaonan Shen b66aaeea99
Add camera support to synology_dsm (#39838)
* Add camera support to synology_dsm

* Code improvements

* More code improvements
2020-09-10 21:08:37 +02:00
Chris Talkington 74219663d6
Fix nzbget sensors (#39833)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-09-09 14:56:40 +02:00
Paulus Schoutsen 1e2741ff1b
Some shelly fixes (#39798) 2020-09-08 15:12:20 +02:00
Simone Chemelli 0c8630a2f0
Support shelly cover(roller) mode (#39711)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-08 10:35:01 +02:00
Tom bb9ea7ce6e
Add tests for Plugwise integration (#36371) 2020-09-08 08:37:44 +02:00
cgtobi ef8cdf0405
Add Kodi media browser support (#39729)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-07 18:22:20 +02:00
Paulus Schoutsen b07628ae57
Rework Shelly sensors (#39747)
* Rework Shelly sensors

* Lint

* Add shelly/entity to coveragerc
2020-09-07 14:13:20 +02:00
Evgeny b0192cf9c0
Add OpenWeatherMap config_flow (#34659)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-04 18:22:50 -05:00
Andrew Marks 01bac9f433
Refactor sharkiq tests (#39564)
* Refactor sharkiq tests

* Fix linting

* Remove unussed logger

* Test one more code branch

* Don't patch integration files

* Remove legacy calls

* Linting fixes

* Refactor coordinator update tests

* Reformat test params

* Refector config flow tests

* Minor code cleanup

* Fix spelling error

* Address review

* Minor formatting change

* Remove vacuum.py from .coveragerc
2020-09-04 15:13:11 -05:00
Markus Bong fa1b8c824c
Add devolo thermostat devices (#38594)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-04 08:33:54 -05:00
Angelo Gagliano eb7742ea7c
Add support for VeSync Fans (#36132)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-03 21:05:37 -05:00
Maciej Bieniek 226406b853
Improve tests for GIOS integration (#39514) 2020-09-03 09:27:21 +02:00
Tom Harris 75153dd4a3
Apply code review for insteon config flow (#39171)
* Move options import to async_setup_entry

* Add tests for insteon init

* Move common constants to const

* Clean up to adhear to standards

* Create mock insteon device manager

* Update for HA standards

* Use keys and align to config_flow steps

* Fix default port for hub v1

* Update doc string to represent function

* Remove dump print commands

* Add modem_type entry

* Simplify dict key test

* Setup platforms in async_setup_entry

* Black

* Black tests
2020-08-30 19:15:09 -04:00
Arda ŞEREMET e707b50658
Add integration for ProgettiHWSW automation boards (#37922)
* Opened a new fresh page to clean my mess.

* Solved pylint warnings

* Fixing pylint issue of defining attr outside init.

* Excluded files from being tested by codecov.

* Solved binary sensor error.

* Fixed some stylisation errors.

* Resolved input not updating problem.

* Added port entry to test file.

* Added tests for create_entry.

* Added support for better state management.

* Increased code coverage of config_flow.py & made some tweaks.

* Increased coverage of config_flow.py by adding tests for unknown exceptions.

* A small bugfix.

* Stylised code as per Chris' suggestions.

* Stylised code again.

* Improved quality of test code.

* Added step_id in config flow tests.
2020-08-30 15:03:33 -05:00
Andrew Marks 3d1ff5b8d0
Add sharkiq integration for Shark IQ robot vacuums (#38272)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-08-30 15:26:11 +02:00
Maciej Bieniek 4aa8b6cad8
Add basic binary_sensor support to Shelly (#39365) 2020-08-30 14:16:41 +02:00
Chris Talkington 7469f57a7b
Add config flow to nzbget (#38938)
* work on config flow

* Update test_init.py

* work on config flow

* Update test_config_flow.py

* Update test_config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Apply suggestions from code review

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

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update config_flow.py

* Update __init__.py

* Update __init__.py

* Create coordinator.py

* Update __init__.py

* Update sensor.py

* Update __init__.py

* Update .coveragerc

* Update coordinator.py

* Update __init__.py

* Update coordinator.py

* Update __init__.py

* Update coordinator.py

* Update config_flow.py

* Update __init__.py

* Update coordinator.py

* Update __init__.py

* Update test_config_flow.py

* Update coordinator.py

* Update test_config_flow.py

* Update test_init.py

* Update homeassistant/components/nzbget/coordinator.py

* Update test_config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-29 16:47:00 -05:00
Paulus Schoutsen 4b8217777e
Add basic light and sensor support to Shelly (#39288)
* Add basic light platform

* Add sensor support

* Bump aioshelly to 0.2.1

* Lint

* Use UNIT_PERCENTAGE

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>

* Format sensor.py

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
2020-08-28 17:33:34 +02:00
Felipe Martins Diel e4d29bf3ec
Add tests for Broadlink sensors (#39230)
* Add tests for Broadlink sensors

* Remove sensor.py from .coveragerc
2020-08-26 22:43:17 -05:00
Chris Talkington ab6fb5cb77
Ensure unique ids are generated for surepetcare (#39196)
* ensure unique ids are generated for surepetcare

* Create test_binary_sensor.py

* work on tests

* Update test_binary_sensor.py

* Update __init__.py

* Update __init__.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update __init__.py
2020-08-25 11:34:14 -05:00
Paulus Schoutsen ca2bc9906d
Add Shelly integration (#39178) 2020-08-24 12:43:31 +02:00
J. Nick Koston 3cc099af80
Make emulated_hue upnp responder async (#39126) 2020-08-23 09:50:59 +02:00
Martin Hjelmare 3cea3eb6e5
Remove dead ozw discovery code (#39098) 2020-08-21 12:44:40 +02:00