Commit Graph

31 Commits (59fe30e589982a4f101e140eaf3e0d12fb668bbd)

Author SHA1 Message Date
Felipe Martins Diel 3bc58f9750
Fix BroadlinkSwitch._attr_assumed_state (#55505) 2021-08-31 22:49:56 -07:00
Felipe Martins Diel 419bcd939b
Fix broadlink creating duplicate unique IDs (2) (#53622) 2021-07-28 18:53:34 +02:00
Felipe Martins Diel 43d3b6c2a2
Move the coordinator logic to the BroadlinkEntity class (#53571) 2021-07-27 13:53:29 -05:00
Daniel Hjelseth Høyer d58a02a647
Broadlink, remove attr_current_power_w and add sensor (#53342) 2021-07-26 08:42:19 -07:00
Robert Hillis 800f7fe3a5
Use entity class attributes for Broadlink (#53058)
* Clanup broadlink

* rework

* tweak

* fix using wrong attribute

* tweak

* revert device info
2021-07-21 15:27:52 +02:00
Franck Nijhof c5d806fdbe
Fix broadlink creating duplicate unique IDs (#52621) 2021-07-07 09:46:59 +02:00
Daniel Hjelseth Høyer 4abdeec36d
Use entity class vars in Broadlink (#52177) 2021-06-25 11:31:17 -10:00
J. Nick Koston 22c8afe637
Create a base class for broadlink entities (#52132)
* Create a base class for broadlink entities

* Update homeassistant/components/broadlink/entity.py

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

* Update homeassistant/components/broadlink/entity.py

* Update homeassistant/components/broadlink/entity.py

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

* black, remove unused

Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
2021-06-25 07:39:21 +02:00
Felipe Martins Diel 9ca0cd5464
Bump broadlink from 0.16.0 to 0.17.0 (#47779) 2021-03-11 21:34:56 -08:00
b4dpxl bb31de1de7
Add support for Broadlink BG1 devices (#42314)
* Support for BG1 switches after config flow updates to core Broadlink component

* updates based on @felipediel feedback

* Update updater.py

* Update switch.py

* Update switch.py
2020-11-14 14:59:41 +01:00
Felipe Martins Diel e5fe0c40ec
Add support for Broadlink SP4 series and the latest SP mini 3 devices (#41522)
* Add support for Broadlink SP4 series

* Bump python-broadlink to 0.16

* Fix stale docstring
2020-11-08 11:19:28 -06: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 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 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
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
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
Bas Nijholt bfa58f671a use isort to sort imports according to PEP8 for broadlink (#29690) 2019-12-09 11:48:52 +01:00
bouni ae5cb82908 moved imports to top level (#27508) 2019-10-12 12:45:31 -07:00
Franck Nijhof 6a24d893c8 Use literal string interpolation in integrations B-D (f-strings) (#26378) 2019-09-03 17:09:59 +02:00
zhumuht 90d493a51a Add broadlink switch retry time option (#25873)
* add broadlink switch retry time in configuration

* add broadlink switch retry time in configuration

* formatted code by black tool

* Change retry default value to 2 to keep the current behavior
2019-08-16 10:26:11 +03:00
miroslawkrol ecddeb2dd1 Fix Broadlink MP1 unavailable error (#25806) 2019-08-09 18:21:18 +03:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Daniel Høyer Iversen 9413b5a415 check for None state in broadlink (#24589) 2019-06-19 10:10:37 +02:00
Daniel Høyer Iversen 7f7435f003 Add support for available property for broadlink (#23981)
* Add support for available property for broadlink

* Broadlink, except oserror

* Broadlink, except oserror
2019-05-23 09:52:30 +02:00
akloeckner e687848152 Make broadlink switch restore its state (#23829)
* Make broadlink switch restore its state

Method copied from pilight switch

* style
2019-05-12 19:28:33 +02:00
Joakim Plate 7a6950fd72 Validate data packet format on config validation (#23062) 2019-04-13 10:58:12 -07: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
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Tobias Sauerwein 048b100eea Clean up docstrings (#22679)
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00
Paulus Schoutsen f5076188ef
Consolidate all platforms that have no tests (#22096)
* Consolidate

* Fix tests

* Update imports

* Fix import

* Use importlib because integration and package share name

* Fix more tests

* Update .coveragerc and CODEOWNERS
2019-03-16 20:44:05 -07:00