75 Commits

Author SHA1 Message Date
HomeAssistant Azure
d73d36d0cd [ci skip] Translation update 2020-10-08 00:06:03 +00:00
Maciej Bieniek
ca441a79aa
Add invalid_host to base strings for config flows (#41381) 2020-10-07 11:24:31 +02:00
HomeAssistant Azure
486c0b644a [ci skip] Translation update 2020-10-07 00:06:20 +00:00
Felipe Martins Diel
34416fcad3
Log device info in Broadlink error messages (#41307) 2020-10-06 08:02:14 -04:00
Joakim Plate
999eeb39b9
Indicate to user that remote was turned off when call was attempted (#40715)
* Indicate to user that remote was turned off when call was attempted

* Catch exception in test

* Switch to warning log

* Apply suggestions from code review

Add suggested change to loggin
2020-10-06 06:12:39 +02:00
HomeAssistant Azure
bcfa4ac959 [ci skip] Translation update 2020-10-06 00:08:09 +00:00
HomeAssistant Azure
8d1d585b40 [ci skip] Translation update 2020-10-05 00:04:23 +00:00
HomeAssistant Azure
f8c2d877aa [ci skip] Translation update 2020-10-04 00:05:05 +00:00
springstan
064a453604
Add already_in_progress to base strings for config flows (#40961) 2020-10-03 15:49:09 +02:00
springstan
04daa9a378
Add name to base strings for config flows (#40947)
* Add name to base strings for config flows

* Fix HA strings.json
2020-10-03 15:28:42 +02:00
HomeAssistant Azure
8d0f1e7db2 [ci skip] Translation update 2020-09-30 00:04:43 +00:00
HomeAssistant Azure
e9e17122e7 [ci skip] Translation update 2020-09-28 00:03:28 +00:00
HomeAssistant Azure
2b00d28af9 [ci skip] Translation update 2020-09-27 00:06:49 +00:00
Felipe Martins Diel
2f4aa35ca6
Bump python-broadlink to 0.15.0 (#39228)
* Rename DeviceOfflineError to NetworkTimeoutError

* Bump python-broadlink to 0.15
2020-09-26 10:46:02 -05:00
HomeAssistant Azure
c30982c981 [ci skip] Translation update 2020-09-25 00:04:29 +00:00
HomeAssistant Azure
75659ff787 [ci skip] Translation update 2020-09-23 00:05:01 +00:00
HomeAssistant Azure
7c344fa0cd [ci skip] Translation update 2020-09-22 00:07:08 +00:00
HomeAssistant Azure
587e3f1eb2 [ci skip] Translation update 2020-09-21 00:02:47 +00:00
HomeAssistant Azure
62c4e072f5 [ci skip] Translation update 2020-09-19 00:07:12 +00:00
Felipe Martins Diel
2f7b6bfa2d
Fix RM mini 3 update manager (#40215) 2020-09-18 15:31:25 +02:00
Felipe Martins Diel
976d8f7abe
Handle an unsupported device in the Broadlink config flow (#40242) 2020-09-18 15:29:26 +02:00
HomeAssistant Azure
ee5c1ea3f7 [ci skip] Translation update 2020-09-12 00:05:00 +00:00
HomeAssistant Azure
07d5af1969 [ci skip] Translation update 2020-09-08 00:04:13 +00:00
HomeAssistant Azure
2f0138e891 [ci skip] Translation update 2020-09-06 00:03:25 +00:00
springstan
d2b1918e9c
Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
HomeAssistant Azure
5ce62c8446 [ci skip] Translation update 2020-09-02 00:03:29 +00:00
HomeAssistant Azure
989a040b67 [ci skip] Translation update 2020-08-29 00:03:59 +00:00
Ville Skyttä
b4bac0f7a0
Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
HomeAssistant Azure
195d4b6897 [ci skip] Translation update 2020-08-27 00:04:55 +00:00
Felipe Martins Diel
067efc7805
Remove services.yaml from the Broadlink integration (#39261) 2020-08-26 10:47:44 +02:00
Felipe Martins Diel
a2c1f08c8c
Implement config flow in the Broadlink integration (#36914)
* Implement config flow in the Broadlink integration

* General improvements to the Broadlink config flow

* Remove unnecessary else after return

* Fix translations

* Rename device to device_entry

* Add tests for the config flow

* Improve docstrings

* Test we do not accept more than one config entry per device

* Improve helpers

* Allow empty packets

* Allow multiple config files for switches related to the same device

* Rename mock_device to mock_api

* General improvements

* Make new attempts before marking the device as unavailable

* Let the name be the template for the entity_id

* Handle OSError

* Test network unavailable in the configuration flow

* Rename lock attribute

* Update manifest.json

* Import devices from platforms

* Test import flow

* Add deprecation warnings

* General improvements

* Rename deprecate to discontinue

* Test device setup

* Add type attribute to mock api

* Test we handle an update failure at startup

* Remove BroadlinkDevice from tests

* Remove device.py from .coveragerc

* Add tests for the config flow

* Add tests for the device

* Test device registry and update listener

* Test MAC address validation

* Add tests for the device

* Extract domains and types to a helper function

* Do not patch integration details

* Add tests for the device

* Set device classes where appropriate

* Set an appropriate connection class

* Do not set device class for custom switches

* Fix tests and improve code readability

* Use RM4 to test authentication errors

* Handle BroadlinkException in the authentication
2020-08-20 17:30:41 +02:00
Felipe Martins Diel
38bb8ef4d2
Clean up command learning in the Broadlink integration (#36318) 2020-06-09 14:15:46 +02:00
Felipe Martins Diel
a7a58b9eac
Fix SP2-CL (0x7544) sensor update (#36242)
* Fix SP2-CL (0x7544) sensor update

This device does not support get_energy(). We need to ignore the CommandNotSupportedError in the update method.

* Format with Black

* Only wrap code that throws with catch

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-06-02 19:44:45 -07:00
Felipe Martins Diel
3d253fa52a
Handle StorageError in the Broadlink integration (#35986) 2020-05-23 11:10:06 +02:00
Felipe Martins Diel
2b38df2766
Allow underscores in broadlink hostnames (#35791)
* Allow underscores in hostnames

* Ignore case
2020-05-19 13:46:12 +02:00
Felipe Martins Diel
6464c94990
Fix connection problems in the Broadlink integration (#34670)
* Use helper functions for exception handling

* Create a separate class to handle communication with the device

* Update manifest

* Use coroutine for service setup

* Fix sensor update

* Update tests

* Fix MP1 switch

* Add device.py to .coveragerc

* Remove unnecessary blocking from test_learn_timeout

* Change access method for entries with default values

* Make the changes suggested by MartinHjelmare

* Remove dot from debug message

* Use underscore for unused variable
2020-05-13 10:36:32 +02:00
Erik Montnemery
066e921a8b
Rename SwitchDevice to SwitchEntity (#34673) 2020-04-26 18:50:37 +02:00
Erik Montnemery
aa60d362fd
Rename RemoteDevice to RemoteEntity (#34676) 2020-04-26 02:12:36 +02:00
Daniel Høyer Iversen
d305247485
upgrade broadlink lib (#34488) 2020-04-21 07:44:41 -04:00
Felipe Martins Diel
a365f456fc
Add support to the new Broadlink RM Mini 3 and RM4 Series (#32523)
* Add device type

* Use snake_case for devtype

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

* Validate device type as positive int

* Add device type 0x5f36 to switch

* Use default type for sensors

* Add RM4 to switch platform

* Use snake_case for devtype

* Support multiple types of remote

* Validate ip address

* Improve code readability

* Add const.py to .coveragerc

* Use None for unknown device types

* Fix sensors and standardize platform schemas

* Fix if statement

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-04-19 01:16:49 +02:00
Daniel Høyer Iversen
2f415b0db1
Upgrade broadlink lib to 0.13.1 (#34290) 2020-04-16 20:51:07 +02:00
Franck Nijhof
39336d3ea3
Add prettier (in pre-commit and CI) (#33693)
* Add prettier (in pre-commit and CI)

* Make all file prettier

* Change order

* Add to Azure Pipelines

* Fix a YAML file prettier caught as invalid

* Remove flow mapping using curly braces from all YAML service files
2020-04-05 17:27:16 +02:00
Franck Nijhof
6f1900c6f4
Replace OSError aliases with OSError (#33655) 2020-04-04 22:09:11 +02:00
Paulus Schoutsen
f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
tiagofreire-pt
21098bc3e5
Upgrade broadlink to 0.13.0 (#33240)
* Upgrading the broadlink library version to 0.13.0

As stated here: https://pypi.org/project/broadlink/

* Update requirements_test_all.txt

* Update requirements_all.txt

* Delete requirements_test_all.txt

* Revert "Delete requirements_test_all.txt"

This reverts commit 008f6f20306ffaeaf3dec97a9ecd5403ad06df6e.

* Revert "Revert "Delete requirements_test_all.txt""

This reverts commit 73e22fd0ffc4fd00ee0e728d2c66a0ac481f805b.

* Revert "Revert "Revert "Delete requirements_test_all.txt"""

This reverts commit 7662119c89b32a16a951818eadfc20898814570f.
2020-03-29 13:03:46 +02:00
springstan
f1a0ca7cd3
Add and use percentage constant (#32094)
* Add and use percentage constant

* Fix pylint error and broken test
2020-02-28 11:46:48 -08:00
springstan
9801810552
Use f-strings in integrations starting with "B"-"E" (#32121)
* Use f-strings in integrations starting with B

* Use f-strings in integrations starting with C

* Use f-strings in integrations starting with D

* Use f-strings in integrations starting with E

* Fix pylint errors

* Fix pylint errors v2

* Fix tests

* Fix tests v2
2020-02-24 08:47:52 -08:00
Bruno Furtado
9f58e5d6ea
Only auth on enter_learning in response to errors for broadlink (#27341)
* Only auth on enter_learning in response to errors.

* Remove extra newline.

* Add missing break on successful attempt.

* Avoid logging success message when auth is unsuccessful.
2020-02-08 16:17:40 -08:00
Christian Clauss
df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00