Commit Graph

27 Commits (1e2f242220f9a635c06f5569f54c2cfd6195effc)

Author SHA1 Message Date
Ville Skyttä 153d6e891e
Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
Felipe Martins Diel e98f27ead6
Use broadlink.hello() for direct discovery (#49405) 2021-04-19 10:16:03 +02:00
Felipe Martins Diel 6a3832484c
Do not log error messages when discovering Broadlink devices (#49394) 2021-04-18 18:12:27 -10:00
J. Nick Koston 35a5f110bd
Update mac address in broadlink test to match mocked device (#48415)
* Update mac address in broadlink test to match mocked device

* Update tests/components/broadlink/test_config_flow.py
2021-03-27 20:47:47 +01:00
J. Nick Koston 388815b81a
Add broadlink dhcp discovery (#48408) 2021-03-27 08:40:19 -10:00
Felipe Martins Diel 9ca0cd5464
Bump broadlink from 0.16.0 to 0.17.0 (#47779) 2021-03-11 21:34:56 -08:00
Ville Skyttä 2fb3be50ab
Make DeviceRegistry.async_get_device connections arg optional (#44897)
* Make async_get_device connections Optional, default None

* Remove unnecessary async_get_device connections arg usages

Some of these were using an incorrect collection type, which didn't
cause issues mostly just due to luck.
2021-01-07 13:49:45 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Felipe Martins Diel 48e954e038
Change instructions for unlocking Broadlink devices (#42023) 2020-11-10 10:42:59 +01: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
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
Felipe Martins Diel a6d3ee90f0
Improve tests for Broadlink config flow (#39894) 2020-09-11 20:00:28 -05:00
Felipe Martins Diel 9f08955fef
Improve tests for Broadlink devices (#39898) 2020-09-11 19:57:07 -05:00
Chris Talkington 48cfbf8662
Improve broadlink sensor tests (#39632) 2020-09-03 20:01:15 -05:00
Felipe Martins Diel 353b40b28a
Add tests for Broadlink remotes (#39235)
* Add tests for Broadlink remotes

* Reformat the tests with Black

* Add a helper method for device setup

* Rename device.setup() to device.setup_entry()

* Apply suggestions from code review

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-09-03 16:51:08 -05:00
Chris Talkington 4682de5ac1
Improve patching in broadlink sensor tests (#39366)
* improve patching in broadlink sensor tests

* Update test_sensors.py

* Update test_sensors.py
2020-08-28 21:26:19 -05:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +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
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 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
Paulus Schoutsen 2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Franck Nijhof 906385172a
String formatting improvements for tests (#33663) 2020-04-05 00:26:08 +02:00
Bas Nijholt bfa58f671a use isort to sort imports according to PEP8 for broadlink (#29690) 2019-12-09 11:48:52 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Joakim Plate 7d5c1ede72 Broadlink fixup unintended breakage from service refactor (#23408)
* Allow host/ipv6 address for broadlink service

This matches switch config and is a regression fix

* Restore padding of packets for broadlink

* Drop unused import

* Fix comment on test
2019-04-25 21:33:05 -05:00
Joakim Plate 0a3e11aa12 Move Broadlink services to component (#21465)
* Register services in broadlink domain

* Add tests for broadlink services

* Resolve review comments

* One more review fix

* Restore auth retry

* Drop unused constants

* Fix flake8 errors
2019-04-12 20:11:36 +02:00