* Delay ZHA group updates to ensure all members are updated first
After turning off a group, when the first device reports "off", the
other devices may still be "on". If HA processes the group state update
quickly enough, the group will see that some devices are on, so the
state of the group will revert back to "on", and then "off" when the
remaining devices all report "off". That would cause the UI toggle to go
back and forward quickly, and automations that trigger with "state: on"
to fire when the user turns the group off.
This PR fixes that by delaying the group state update, giving time for
all the devices to report their states first.
* Fix zha group tests
* Reorder sleeping.
* Update tests/components/zha/common.py
Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
* add flag to prevent sending an on command
* fix condition
* add constant for default transition
* make groups work with new force on flag
* reorder light entity creation
* rearrange logic
* update test
* remove failed attempt at group light flag
* fix flag
* Add suggested_area to MQTT Discovery
This adds suggested_area to MQTT discovery, so that the discovered devices could be automatically added to the proper area.
* Add abbreviation for MQTT suggested_area
* Remove extra whitespace
* Remove extra whitespace #2
* Added tests for MQTT Dicovery of suggested_area
* Fix test for MQTT suggested_area
* Better tests of MQTT suggested_area
Changes made as per feedback from @emontnemery
* Fix homekit checking for port cleanup too many times
The loop should have terminated as soon as the port was available
* coverage
* tweak homekit shutdown wait
* Add timeouts on recving packets
Add a timeout when recving packets from the worker thread in case it hangs.
Add an exit condition just in case the while loop goes on forever.
* Add a timeout to recorder thread join.
* Wait for recorder thread to be invoked in tests
Remove the while loop and instead wait for segments to be produced by the background worker thread.
* Allow worker to resume before stopping to fix timeouts
* Lower test timeout further
* Remove test_stream_ended since it is flaky
This test doesn't really add additional value on top of other tests.
* Report tilt position properly when inverting using tilt_max < tilt_min
* Add warning per review comment
* Add test for inverted tilt position configuration
* Separate non-numeric and out of range warnings per review comment
* Fix out of range message and add tests for not numeric and out of range messages
* Add device class CO2 to Fibaro
* Add device class CO2 to Awair
* Add device class CO2 to Tasmota
* Add device class CO2 to Netatmo
* Add device class CO2 to Ambient Station
* Update Tasmota tests
* Remove icon
So far the Flo integration only supports shutoff valves. Add support for Flo leak detector pucks, which measure temperature and humidity in addition to providing leak alerts.
* Use SwitchEntity instead of ToggleEntity and adjust test patches as recommended
* Move async_create_entry out of try block in config_flow
* Patch pypi package instead of HA code
* Bump pylitterbot to 2021.2.6, fix tests, and implement other code review suggestions
* Bump pylitterbot to 2021.2.8, remove sleep mode start/end time from vacuum, adjust and add sensors for sleep mode start/end time
* Move icon helper back to Litter-Robot component and isoformat times on time sensors
* Improve restoring data and better handling when the restore data is empty
Improve readability of some logic related to POE clients
* There is no need to check clients_all in Switch platform
* Add better tests when restoring state
* Port except handling shouldn't be needed anymore
* Walrusify get_last_state
* Increase coverage of init
* Increase coverage of config_flow
* Improve coverage of controller
* Minor improvement to switch test
* Fix review comment
* Mock websocket class
* Replace the rest of the old websocket event tests
* Improve websocket fixture for cleaner tests
* Fix typing
* Improve connection state signalling based on Martins feedback
* Improve tests of reconnection_mechanisms based on Martins review comments
* Fix unload entry
* Fix isort issue after rebase
* Fix martins comment on not using caplog
* Fix wireless clients test
* Fix martins comments on wireless clients test
* Initial prototype of automation tracing
* Small fixes
* Lint
* Move trace helpers to its own file
* Improve trace for state and numeric_state conditions
* Tweaks + apply suggestions from code review
* Index traces by automation_id, trace while script is running
* Refactor condition tracing
* Improve WS API to get traces for single automation
* Add tests
* Fix imports
* Fix imports
* Address review comments
* Cap logging of loops
* Remove unused ContextVar action_config
* A platform is not a component
* Fix dynalite
* SUPPORTED_PLATFORMS --> PLATFORMS
* In tests
* In tests 2
* Fix SmartThings
* Fix ZHA test
* Fix Z-Wave
* Revert Z-Wave
* Use PLATFORMS const in ambient_station
* Fix ihc comment
* Add force update also to non-binary sensors as e.g. POWER Measurement agerage cannot be calculated otherwise. This is the same behavior as set with the obsolete tasmota detection
* add tests in binary_sensor and test_sensor for force_update flag
* satisfy flake8
* next try for force_update test but this time on the entity object which is the correct level
* once again satisfy flake8
* one more try for a test
* fix typo
* satisfy black
* Add init test to Freebox
* Review : more readable conftest
* Expect 2 blank lines between defs
* Review : Not I/O in the event loop
* Fix test_setup test
* remove useless const
* Review : mock setup methods
* Add service test
* Add import test
* Unused pylint suppression cleanups
* Remove outdated pylint bug references
* Add flake8-noqa config and note to run it every now and then
* Add codes to noqa's
* Unused noqa cleanups
* add addon_update service, use config flow to set up config entry, create disabled sensors
* move most of entity logic to common entity class, improve device info, get rid of config_flow user step
* fix setup logic
* additional refactor
* fix refactored logic
* fix config flow tests
* add test for addon_update service and get_addons_info
* add entry setup and unload test and fix update coordinator
* handle if entry setup calls unload
* return nothing for coordinator if entry is being reloaded because coordinator will get recreated anyway
* remove entry when HA instance is no longer hassio and add corresponding test
* handle adding and removing device registry entries
* better config entry reload logic
* fix comment
* bugfix
* fix flake error
* switch pass to return
* use repository attribute for model and fallback to url
* use custom 'system' source since hassio source is misleading
* Update homeassistant/components/hassio/entity.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* update remove addons function name
* Update homeassistant/components/hassio/__init__.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* fix import
* pop coordinator after unload
* additional fixes
* always pass in sensor name when creating entity
* prefix one more function with async and fix tests
* use supervisor info for addons since list is already filtered on what's installed
* remove unused service
* update sensor names
* remove added handler function
* use walrus
* add OS device and sensors
* fix
* re-add addon_update service schema
* add more test coverage and exclude entities from tests
* check if instance is using hass OS in order to create OS entities
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
If an entity changes between restart the iOS/controller
device may have cached the old chars for the accessory.
To force the iOS/controller to reload the chars, we
increment the config version when Home Assistant restarts
* Handle stream failures in recorder
Fail gracefully with an error message when the recorder is invoked with no segments due to a stream failure.
* Update homeassistant/components/stream/recorder.py
Co-authored-by: uvjustin <46082645+uvjustin@users.noreply.github.com>
Co-authored-by: uvjustin <46082645+uvjustin@users.noreply.github.com>