* Moved color commands to a new ``async_handle_color_commands`` method
* Fixed tests
* Fix brightness jumping around during transitions
* Add config option to disable "Enhanced brightness slider during light transition"
* fix polling currentSaturation
* Guard light groups against enhanced current hue
* Use XY if all group members do not support HS
* add config option to always prefer XY color mode
* use correct enum
* remove periods
* Set min transition time for Sengled lights in ZHA groups
* Change test to expect correct min transition time for group with Sengled light
* Fix turn_off with transition 0 for Sengled lights
* Fix bluetooth integration with service_data and service_uuids
We would only dispatch a new flow when the address was seen for
the first time or the manufacturer_data appeared in a followup
advertisement. Its also possible for the service_data and
service_uuids to appear in a followup advertisement so we
need to track these as well
* improve logging to avoid overly large messages
* improve logging to avoid overly large messages
* adjust
* adjsut
* split
* coverage
* coverage
* coverage
* coverage
* fix matcher
* more coverage
* more coverage
* more coverage
* revert switchbot changes and move to seperate PR
* Support for encrypted devices
* Sensor should use bindkey if available
* Error message if encryption fails
* Let mypy know this is always set by now
* Towards supporting encryption in step_user
* Add tests for the 4 new happy paths
* Add test coverage for failure cases
* Add strings
* Bump to 0.5.1. Legacy MiBeacon does not use an authentication token, so harder to detect incorrect key
* Add _title() helper
* Fix test after rebase
* Update homeassistant/components/xiaomi_ble/strings.json
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Remove unused lines
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update switchbot to be local push
* fixes
* fixes
* fixes
* fixes
* adjust
* cover is not assumed anymore
* cleanups
* adjust
* adjust
* add missing cover
* import compat
* fixes
* uses lower
* uses lower
* bleak users upper case addresses
* fixes
* bump
* keep conf_mac and deprecated options for rollback
* reuse coordinator
* adjust
* move around
* move around
* move around
* move around
* refactor fixes
* compat with DataUpdateCoordinator
* fix available
* Update homeassistant/components/bluetooth/passive_update_processor.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/bluetooth/passive_update_coordinator.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/bluetooth/update_coordinator.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Split bluetooth coordinator into PassiveBluetoothDataUpdateCoordinator and PassiveBluetoothProcessorCoordinator
The PassiveBluetoothDataUpdateCoordinator is now used to replace instances
of DataUpdateCoordinator where the data is coming from bluetooth
advertisements, and the integration may also mix in active updates
The PassiveBluetoothProcessorCoordinator is used for integrations that
want to process each bluetooth advertisement with multiple processors
which can be dispatched to individual platforms or areas or the integration
as it chooes
* change connections
* reduce code churn to reduce review overhead
* reduce code churn to reduce review overhead
* Update homeassistant/components/bluetooth/passive_update_coordinator.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* add basic test
* add basic test
* complete coverage
* Update homeassistant/components/switchbot/coordinator.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/switchbot/coordinator.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/switchbot/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/switchbot/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* lint
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add Govee BLE integration
* add missing files
* remove test file not needed yet
* fix
* add bbq sensors
* fixed lib
* bump again to fix the names
* fix discovery of the newer bbq devices
* fix the test to test the right thing
* verify no outstanding flows
* only accept entities that match the platform
* refactor
* refactor
* refactor
* Refactor PassiveBluetoothDataUpdateCoordinator to support multiple platforms
* cover
* Update for new model
* Update for new model
* Update tests/components/govee_ble/test_sensor.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* purge dead code
* backmerge from integration
* Update docstring
* Update docstring
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Initial xiaomi_ble integration
* black
* Update homeassistant/components/xiaomi_ble/config_flow.py
Co-authored-by: Ernst Klamer <e.klamer@gmail.com>
* Update homeassistant/components/xiaomi_ble/config_flow.py
Co-authored-by: Ernst Klamer <e.klamer@gmail.com>
* Apply suggestions from code review
Co-authored-by: Ernst Klamer <e.klamer@gmail.com>
* Update tests/components/xiaomi_ble/test_config_flow.py
Co-authored-by: Ernst Klamer <e.klamer@gmail.com>
* Update homeassistant/components/xiaomi_ble/sensor.py
Co-authored-by: Ernst Klamer <e.klamer@gmail.com>
* Update tests/components/xiaomi_ble/test_config_flow.py
Co-authored-by: Ernst Klamer <e.klamer@gmail.com>
* Remove debug code
* Need 'proper' MAC when running tests on linux
* Need to use proper MAC so validation passes
* Add tests for already_in_progress and already_configured
* copy test, add session fixture
* fix test
Co-authored-by: Ernst Klamer <e.klamer@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Switchbot add support for hygrometers
* Update CODEOWNERS
* Improve debug
* Remove redundant mention to temp unit
* Adopt FlowResultType
* Modify SwitchBot data within coordinator
* Increase logging for switchbot sensor
* Revert "Increase logging for switchbot sensor"
This reverts commit d8b377429c.
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add ZHA config option for "enhanced light transition from an off-state"
* Default option to disabled
* Always disable "enhanced light transition" for ZHA LightGroups
* Rename _enhanced_light_transition to _zha_config_enhanced_light_transition
* Remove LightGroup check, as config option always disables for groups
* Remove duplicated line
* Remove duplicated line
* Move ZHA config transition line below other config line
* Renamed comments of renamed variable in tests
color_provided_while_off -> new_color_provided_while_off
* Enable "enhanced light transitions" for testing
* use base class attributes
* initial hue and saturation support
* spec is 65536 not 65535
* fixes
* enhanced current hue
* fix comparison
* clean up
* fix channel test
* oops
* report enhanced current hue
* Use new entity naming style
* Move AccuWeatherSensorDescription and SENSOR consts to sensor platform
* Remove duplicate code
* Suggested change
* Format url
* Avoid converting BluetoothServiceInfo to a dict for default discovery
Fixes
```
2022-07-19 09:46:48.303 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/Users/bdraco/home-assistant/homeassistant/helpers/discovery_flow.py", line 74, in _async_process_pending_flows
await gather_with_concurrency(
File "/Users/bdraco/home-assistant/homeassistant/util/async_.py", line 201, in gather_with_concurrency
return await gather(
File "/Users/bdraco/home-assistant/homeassistant/util/async_.py", line 199, in sem_task
return await task
File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 222, in async_init
flow, result = await task
File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 249, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data, init_done)
File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 359, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/Users/bdraco/home-assistant/homeassistant/config_entries.py", line 1484, in async_step_bluetooth
return await self.async_step_discovery(dataclasses.asdict(discovery_info))
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py", line 1239, in asdict
return _asdict_inner(obj, dict_factory)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py", line 1246, in _asdict_inner
value = _asdict_inner(getattr(obj, f.name), dict_factory)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py", line 1280, in _asdict_inner
return copy.deepcopy(obj)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 161, in deepcopy
rv = reductor(4)
TypeError: Cannot pickle Objective-C objects
```
* Avoid converting BluetoothServiceInfo to a dict for default discovery
Fixes
```
2022-07-19 09:46:48.303 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/Users/bdraco/home-assistant/homeassistant/helpers/discovery_flow.py", line 74, in _async_process_pending_flows
await gather_with_concurrency(
File "/Users/bdraco/home-assistant/homeassistant/util/async_.py", line 201, in gather_with_concurrency
return await gather(
File "/Users/bdraco/home-assistant/homeassistant/util/async_.py", line 199, in sem_task
return await task
File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 222, in async_init
flow, result = await task
File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 249, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data, init_done)
File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 359, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/Users/bdraco/home-assistant/homeassistant/config_entries.py", line 1484, in async_step_bluetooth
return await self.async_step_discovery(dataclasses.asdict(discovery_info))
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py", line 1239, in asdict
return _asdict_inner(obj, dict_factory)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py", line 1246, in _asdict_inner
value = _asdict_inner(getattr(obj, f.name), dict_factory)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py", line 1280, in _asdict_inner
return copy.deepcopy(obj)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 161, in deepcopy
rv = reductor(4)
TypeError: Cannot pickle Objective-C objects
```
* rename variable
* default transition is for color commands not level
* no extra command for groups
* don't transition color change when light off -> on
* clean up
* update condition
* fix condition again...
* simplify
* simplify
* missed one
* rename
* simplify
* rename
* tests
* color_provided_while_off with no changes
* fix missing flag clear
* more tests for transition scenarios
* add to comment
* fix comment
* don't transition when force on is set
* stale comment
* dont transition when colors don't change
* remove extra line
* remove debug print :)
* fix colors
* restore color to 65535 until investigated
BLEDevice is now passed around instead of the address
internally to avoid bleak creating a new scanner each
time a client needs to resolve the address to os details