Commit Graph

4441 Commits (d93c09327abdbaa40e94f782042c4b1d204ac2e8)

Author SHA1 Message Date
Paulus Schoutsen d93c09327a
Report unserializable data in websocket (#34072)
* Report unserializable data in websocket

* Fix tests

* log types too
2020-04-13 23:46:41 -07:00
Paulus Schoutsen bea354b82a
Allow WS queue to temporarily peak (#34175)
* Allow WS queue to temporarily peak

* Remove unused code
2020-04-13 18:50:36 -07:00
Paulus Schoutsen 89fe488b7c
Add websocket API to update config entry title (#34155) 2020-04-13 17:38:39 -07:00
J. Nick Koston 29f50ddc9c
Fix z-wave brightness off by one (#34170)
Z-wave would drop the floating point by calling
int() instead of round() which would result in
the brightness being off by one in many cases.
2020-04-13 17:51:35 -05:00
jrester 6924192523
Use updated powerwall client API library (#34139)
* Use updated powerwall client API library

* Increase instant_power precision to 3

* Add @jrester as code owner for powerwall
2020-04-13 21:59:50 +02:00
Robert Chmielowiec 7bd6f5413d
Add flash light device actions (#33689)
* Add flash light device actions

* Single action with extra fields

* Change extra_fields to dictionary
2020-04-13 10:30:20 -07:00
Franck Nijhof 6d24a65313
Various light test improvements (#34131) 2020-04-13 15:33:04 +02:00
Austin Mroczek c7ab5de07c
Add Totalconnect config flow (#32126)
* Bump skybellpy to 0.4.0

* Bump skybellpy to 0.4.0 in requirements_all.txt

* Added extra states for STATE_ALARM_TRIGGERED to allow users to know if
it is a burglar or fire or carbon monoxide so automations can take
appropriate actions.  Updated TotalConnect component to handle these new
states.

* Fix const import

* Fix const import

* Fix const imports

* Bump total-connect-client to 0.26.

* Catch details of alarm trigger in state attributes.

Also bumps total_connect_client to 0.27.

* Change state_attributes() to device_state_attributes()

* Move totalconnect component toward being a multi-platform integration.  Bump total_connect_client to 0.28.

* add missing total-connect alarm state mappings

* Made recommended changes of MartinHjelmare at
https://github.com/home-assistant/home-assistant/pull/24427

* Update __init__.py

* Updates per MartinHjelmare comments

* flake8/pydocstyle fixes

* removed . at end of log message

* added blank line between logging and voluptuous

* more fixes

* Adding totalconnect zones as HA binary_sensors

* fix manifest.json

* flake8/pydocstyle fixes.  Added codeowner.

* Update formatting per @springstan guidance.

* Fixed pylint

* Add zone ID to log message for easier troubleshooting

* Account for bypassed zones in update()

* More status handling fixes.

* Fixed flake8 error

* Another attempt at black/isort fixes.

* Bump total-connect-client to 0.50.  Simplify code using new functions in
total-connect-client package instead of importing constants.  Run black
and isort.

* Fix manifest file

* Another manifest fix

* one more manifest fix

* more manifest changes.

* sync up

* fix indent

* one more pylint fix

* Hopefully the last pylint fix

* make variable names understandable

* create and fill dict in one step

* Fix name and attributes

* rename to logical variable in alarm_control_panel

* Remove location_name from alarm_control_panel attributes since it is
already the name of the alarm.

* Multiple fixes to improve code per @springstan suggestions

* Update homeassistant/components/totalconnect/binary_sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Multiple changes per @MartinHjelmare review

* simplify alarm adding

* Fix binary_sensor.py is_on

* Move DOMAIN to .const in line with examples.

* Move to async_setup

* Simplify code using new features of total-connect-client 0.51

* First crack at config flow for totalconnect

* bump totalconnect to 0.52

* use client.is_logged_in() to avoid total-connect-client details.

* updated generated/config_flow.py

* use is_logged_in()

* Hopefully final touches for config flow

* Add tests for config flow

* Updated requirements for test

* Fixes to test_config_flow

* Removed leftover comments and code

* fix const.py flake8 error

* Simplify text per @Kane610 https://github.com/home-assistant/home-assistant/pull/32126#pullrequestreview-364652949

* Remove .get() to speed things up since the required items should always
be available.

* Move CONF_USERNAME and CONF_PASSWORD into .const to eliminate extra I/O
to import from homeassistant.const

* Fix I/O async issues

* Fix flake8 and black errors

* Mock the I/O in tests.

* Fix isort error

* Empty commit to re-start azure pipelines (per discord)

* bump total-connect-client to 0.53

* Update homeassistant/components/totalconnect/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/totalconnect/config_flow.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Fixes per @balloob comments

* Fix imports

* fix isort error

* Fix async_unload_entry

It still referenced CONF_USERNAME instead of entry.entity_id

* Added async_setup so not breaking change.  Fixed imports.

* Update tests/components/totalconnect/test_config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Remove TotalConnectSystem() per @MartinHjelmare suggestion

* Moved from is_logged_in() to is_valid_credentials()

The second is more accurate for what we are checking for, because is_logged_in() could return False due to connection error.

* Fix import in test

* remove commented code and decorator

* Update tests/components/totalconnect/test_config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* fix test_config_flow.py

* bump total-connect-client to 0.54

* remove un-needed import of mock_coro

* bump to total-connect-client 0.54.1

* re-add CONFIG_SCHEMA

* disable pylint on line 10 to avoid pylint bug

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-12 21:29:57 -05:00
J. Nick Koston 5d649b2541
Convert homekit thermostats to use service callbacks (#34073)
* Convert homekit thermostats to use service callbacks

Service callbacks allow us to get all the temperature
changes in one request so we can avoid all the
need to store state and debounce.

* remove excess debug

* Fix lock and light tests

* Ensure all code for Thermostats has coverage

* I am answering all the homekit cases anyways so might as well be aware of regressions

* Make lock notifications reliable

* Update homeassistant/components/homekit/type_lights.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-12 17:38:33 -05:00
J. Nick Koston 173d7fa060
Handle all zero serial numbers in NUT (#34045)
* Handle all zero serial numbers in NUT

* Add additional nut tests

* Update homeassistant/components/nut/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* remove re

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-12 15:29:35 -07:00
J. Nick Koston c75d3ce8c7
Add tilt support to basic homekit window covers (#33937)
* Add tilt support to basic homekit window covers

* Add stop support to all window covers

* protect supports_stop
2020-04-12 15:27:17 -07:00
MatthewFlamm e6a6c3ceb6
Fix nws platform setup and data update. (#34106)
* add test and fix tests for update logging.

* Fix update logging.

* Remove assert is True

* guard against platform config and use async_write_ha_state

* fix discovery info passing to platform

* Improve testing for entities in init
2020-04-12 17:19:22 -05:00
J. Nick Koston ad5a396c10
Fix reversed door closing/opening states in HomeKit (#34095)
* Fix reversed door closing/opening states in HomeKit

When we closed the door we would set state 2 which
is "Opening" it should have been 3 which is
"Closing"

When we opened the door we would set state 3 which
is "Closing" it should have been 2 which is
"Opening"

Add constants to make this easier to catch
in the future.

* Remove debug

* Add note about target door state
2020-04-12 15:15:55 -07:00
Erik Montnemery ec2c7ea932
Don't do http requests to determine Cast device details (#34082)
* Don't do http requests to determine cast device details

* Fix tests

* Update homeassistant/components/cast/media_player.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-12 15:02:28 -07:00
Ziv 200e140e80
Fixed uncaught exceptions for demo (#34117) 2020-04-12 14:10:05 -07:00
springstan 538bb60022
Add and use UNIT_CONDUCTIVITY constant (#34107) 2020-04-12 21:26:20 +02:00
J. Nick Koston 4b1626a748
Config flow for tado (#33677)
* Config flow for tado

* Add homekit models

* self review fixes

* reduce since the loop is gone

* Update homeassistant/components/tado/water_heater.py

Co-Authored-By: Michaël Arnauts <michael.arnauts@gmail.com>

* Change identifier

* Ensure fallback mode is on by default

* unique ids much be str

Co-authored-by: Michaël Arnauts <michael.arnauts@gmail.com>
2020-04-12 13:42:36 -05:00
J. Nick Koston 5aca16ef01
Add homekit configuration option to bind to default interface (#33999)
* Add homekit configuration option to bind to default interface

Homekit can fail to be discoverable because the
zeroconf default is to bind to all interfaces
(InterfaceChoice.All).  This does not work
on some systems and (InterfaceChoice.Default) which
binds to 0.0.0.0 is needed for homekit to zeroconf
to function.

A new option is available for homekit

zeroconf_default_interface: true

* Update tests

* Update homeassistant/components/homekit/__init__.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/homekit/__init__.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Review items

* has a default

* Revert "has a default"

This reverts commit 24ecf0920f.

Breaks the tests

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-04-12 09:59:50 -05:00
J. Nick Koston f965fb6350
Fix nexia fan and hold modes for XL824 thermostats (#34042)
* Fix nexia fan and hold modes for XL824 thermostats

* Update nexia to 0.9.0

* Update tests to reflect the modes that now come directly in
2020-04-12 15:25:57 +02:00
Martin Hjelmare 20aa089243
Clean up camera and demo camera (#34058)
* Clean up demo camera

* Complete test_motion_detection

* Clean up image reading

* Clean up camera integration async methods

* Fix and clean camera integration tests

* Fix image processing patch
2020-04-12 14:56:19 +02:00
J. Nick Koston 24c45bfd84
Restore ability to change the scan interval in the NUT (#33996)
* Support changing the scan interval in the NUT options flow

* use dict.items()
2020-04-11 19:37:34 -05:00
springstan 9f713dac7f
Use UNIT_PERCENTAGE constant (#34054) 2020-04-11 22:53:48 +02:00
Franck Nijhof 123ae941a9
Various camera test improvements (#34022) 2020-04-11 21:10:15 +02:00
J. Nick Koston 6e6ebb9495
Add tests for various NUT upses (#34034) 2020-04-11 18:17:57 +02:00
Save me 8c4a139aeb
Add config_flow for Roomba (#33302)
* Add config_flow for roomba

* Get options to connect

* Fix options in config flow

* Fix syntax in config_flow

* Remove name (not necessary)

* Add bin sensor

* Add Battery sensor

* Add async_connect

* Fix typo

* Add Model and Software version

* Update Roombapy 1.5.0

* Add validate_input

* Add connect and disconnect functions

* Remove test config flow

* Add variables after loop

* Fix translate

* Fix typo

* Fix state of bin

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Remove invalid auth

* Add call function reported_state

* Add options reload

* Fix tracelog

* Set entry_id for config_entry

* Fix DOMAIN unsed-import

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add unique_id for entry

* Fix device info

* Add config_flow for roomba

* Get options to connect

* Fix options in config flow

* Fix syntax in config_flow

* Remove name (not necessary)

* Add bin sensor

* Add Battery sensor

* Add async_connect

* Fix typo

* Add Model and Software version

* Update Roombapy 1.5.0

* Add validate_input

* Add connect and disconnect functions

* Remove test config flow

* Add variables after loop

* Fix translate

* Fix typo

* Fix state of bin

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Remove invalid auth

* Add call function reported_state

* Add options reload

* Fix tracelog

* Set entry_id for config_entry

* Fix DOMAIN unsed-import

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add unique_id for entry

* Fix device info

* syntax for mac (pyupgrade)

* Change single key to BLID

* Resolve dict conflict

* Update homeassistant/components/roomba/binary_sensor.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/sensor.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/.translations/en.json

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/strings.json

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add description

* Revert "Remove test config flow"

This reverts commit 26a89422e8.

* Add tests

* Remove check if user none

* Replace CONF_USERNAME to CONF_BLID (breaking change)

* Update test_config_flow.py

* Add code owners

* Remove CONF_USERNAME (unused)

* Add multiple vacuum

* Add multiple vacuum

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Fix syntax name

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Remove CONF_PREFIX (unused)

* Update homeassistant/components/roomba/sensor.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add import UNIT_PERCENTAGE

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 10:55:00 -05:00
springstan b893150154
Add and use UNIT_DEGREE constant (#33978)
* Add and use UNIT_DEGREE constant

* Replace more occurrences

* Add and use TEMP_KELVIN

* Run isort
2020-04-11 16:54:11 +02:00
Kevin Eifinger c18a6d5ea3
Fix #33995 Use "now" if departure is None (#34017) 2020-04-11 16:47:07 +02:00
springstan f839ba00eb
Use POWER_WATT constant (#33984) 2020-04-11 15:40:59 +02:00
David F. Mulcahey c1962a4895
Read min and max mireds from ZHA lights (#33983)
* implement min and max mireds

* remove unnecessary else

* additional light test

* add test to appease the codecov god

* change defaults
2020-04-10 23:19:17 -04:00
springstan 328cadbaa2
Use LENGTH_KILOMETERS constant (#33976)
* Use LENGTH_KILOMETERS constant

* Fix tests by importing the constant directly
2020-04-11 02:12:39 +02:00
springstan 04c4501455
Add and use UNIT_VOLT constant (#33994)
* Add and use UNIT_VOLT constant

* Run isort
2020-04-11 02:04:58 +02:00
Steven Looman dfc66b2018
Rewrite parts of upnp component (#33108)
* Rewrite parts of upnp component

* Linting

* Add SCAN_INTERVAL

* Get values simultaneously

* Move to time related constants, as per #32065

* Linting

* Move constant KIBIBYTE to homeassistant.const

* Simplify code

* Fix tests for #33344

* Changes after review

* Update homeassistant/components/upnp/sensor.py

* Changes after review

* Formatting

* Formatting

* Use ST from discovery info to avoid swapping device_types if device advertises multiple versions

* Linting

* Requirements for upnp + dlna_dmr components

* Linting

* Regen requirements

* Changes after review by @MartinHjelmare

* Changes after review by @MartinHjelmare

* Formatting

* Linting

* Changes after review by @MartinHjelmare

* Changes after review by @MartinHjelmare

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-11 00:24:03 +02:00
Ziv 302e631984
Ability to mock long poll requests + refactor qwikswitch unit… (#33804)
* added the ability to mock a "long poll" get request by setting up the
waiting request and feeding responses to it
with this, refactored the qwikswitch test so it doesn't use global variables
and is more understandable and maintainable

* added import asyncio from merge

* added assert that first call with long_poll has empty content

* passing json instead of the binary string

* use json instead of text in mock requests

* refactored to use a proxy

* return the proxy also for the http methods other than get

* refactored so any side_effect can be used and created the long_poll side effect

* simplified by using kwargs
needed to move the json->text->content logic from mocker to mockrequest

* no need to explicitly define method and url
2020-04-10 14:57:39 -07:00
David F. Mulcahey 13dda7bd98
Cleanup ZHA group entity lifecycle (#33977)
* Clean up ZHA group entity lifecycle

* group entities don't use state restore

* add tests
2020-04-10 13:17:48 -07:00
springstan 25198242c1
Use TEMP_FAHRENHEIT constant (#33969) 2020-04-10 21:10:10 +02:00
springstan 02c9e47db8
Use ENERGY_KILO_WATT_HOUR constant (#33962) 2020-04-10 20:21:29 +02:00
Erik Montnemery 6d3046cb42
Remove support for cast dynamic speaker groups (#33884) 2020-04-10 10:36:57 -07:00
springstan 78d87dc40f
Use TEMP_CELSIUS constant (#33963) 2020-04-10 19:17:46 +02:00
J. Nick Koston ca0648afe8
Fix powerwall units (kW) (#33954)
* Fix powerwall units (kW)

* Fix test

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-04-10 09:33:58 -07:00
Erik Montnemery a0b3a9e50b
Discover manually added casts (#33922)
* Discover manually added casts
2020-04-10 17:19:44 +02:00
J. Nick Koston a000af5c03
Fix tplink HS220 dimmers (round 2) (#33928)
* HS220 dimmers are handled as lights with a limited feature set

* Dimmers look up has has_emeter every call so this is cached as well now
to resovle the performance issue.
2020-04-09 17:10:02 -07:00
Kit Klein c2d1db61b6
Exclude access token from host info updates in Konnected config flow (#33912)
* black updates

* test that host update doesn't impact access token
2020-04-10 01:16:33 +02:00
jjlawren 42ca566e05
Improve Plex debounce/throttle logic (#33805)
* Improve Plex debounce/throttle logic

* Use Debouncer helper, rewrite affected tests

* Mock storage so files aren't left behind

* Don't bother with wrapper method, store debouncer call during init

* Test cleanup from review

* Don't patch own code in tests
2020-04-10 00:49:09 +02:00
Franck Nijhof 30c6ace0f3
Rewrite MQTT & demo Lock tests (#33838)
* Refactor tests to remove tests.lock.common

* Remove unused is_locked hass binding

* Import constants via entity component

* Import constants via entity component

* Fix light vs lock in naming
2020-04-10 00:40:51 +02:00
J. Nick Koston 6b2baae0de
Fix tplink HS220 dimmers (#33909)
* HS220 dimmers are handled as lights with a limited feature set
2020-04-09 15:07:39 -07:00
jan iversen 9535dd87b0
Rename domain import in modbus (#33906) 2020-04-09 22:15:20 +02:00
springstan bc26be3c11
Add and use HTTP_FORBIDDEN constant (#33839) 2020-04-09 17:41:17 +02:00
On Freund a4c9446b8d
Fix Monoprice robustness (#33869)
* Silently handle update failures

* Limite parallel updates

* Remove return values

* Remove trailing return

* Add test for empty update
2020-04-09 17:04:12 +02:00
Quentame 45b28b8b00
Add local_ip unique_id & icon and single_instance_allowed (#33483)
* Add config flow + sensor unique_id & icon to local_ip

* single_instance_allowed

* Fix test

* Martin's review

* Name deprecated
2020-04-09 16:06:01 +02:00
Erik Montnemery 3845539577
Lookup manufacturer name for casts (#33845)
* Lookup manufacturer name, remove use of get_multizone_status

* Bump pychromecast

* Bump pychromecast

* Fix test
2020-04-09 10:58:19 +02:00