* 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.
* 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
* Add support for learning RF codes with Broadlink remotes
* Rename INFRARED and RADIOFREQUENCY to COMMAND_TYPE_IR and COMMAND_TYPE_RF
* Rewrite if expression as normal if statement
* Use COMMAND_TYPE_IR directly and improve error messages
* 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
* 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.
* 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
* 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>
* 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
* 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>
* 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
* 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
* 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.
* Add broadlink remote control platform
* Fix order of the imports
* Add remote.py to .coveragerc
* Optimize MAC address validation
* Use storage helper class and improve code readability
* Add me to the manifest as a code owner
* Fix dosctring
* Add me to the code owners
* Remove storage schemas, rename storage keys and improve readability