* Restore states through a JSON store
* Accept entity_id directly in restore state helper
* Keep states stored between runs for a limited time
* Remove warning
* Add cloud webhook support
* Simplify payload
* Add cloud http api tests
* Fix tests
* Lint
* Handle cloud webhooks
* Fix things
* Fix name
* Rename it to cloudhook
* Final rename
* Final final rename?
* Fix docstring
* More tests
* Lint
* Add types
* Fix things
* Enable BMW component to be unit system aware
* lint fixes
* use constants for config entries
* remove configuration from component and rely only on HA config of unit_system
* remove unused import
* update code to reflect feedback
* lint fixes
* remove unnecessary comments
* rework return statement to satisfy pylint
* more lint fixes
* add tests for volume utils
* lint fixes
* more lint fixes
* remove unnecessary comments
* Fixed file corruption bugs in private storage code.
* Restoring fixed test case.
* Implemented test suite for utils/json.py
* Added new unit test cases for util/json.py
* Dixed formatting nags
* Fixed more nags from the Hound
* Added doc strings to some very short functions
* Fixing lint's complains about my choice of parts of speach. Sigh.
* Moved atomic save operations down into util/json.py so that all benefit.
Added extra clean-up code to ensure that temporary files are removed in
case of errors.
Updated emulated_hue unit tests to avoid errors.
* Apparently 'e' is not allows as a variable name for an exception...
## Description:
More fixes flagged by pylint 2 that don't hurt to have before the actual pylint 2 upgrade (which I'll submit soon).
## Checklist:
- [ ] The code change is tested and works locally.
- [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
## Description:
Make typing checks more strict: add `--strict-optional` flag that forbids implicit None return type. This flag will become default in the next version of mypy (0.600)
Add `homeassistant/util/` to checked dirs.
## Checklist:
- [x] The code change is tested and works locally.
- [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
* Accept and report both xy and RGB color for lights
* Fix demo light supported_features
* Add new XY color util functions
* Always make color changes available as xy and RGB
* Always expose color as RGB and XY
* Consolidate color supported_features
* Test fixes
* Additional test fix
* Use hue/sat as the hass core color interface
* Tests updates
* Assume MQTT RGB devices need full RGB brightness
* Convert new platforms
* More migration
* Use float for HS API
* Fix backwards conversion for KNX lights
* Adjust limitless min saturation for new scale
* phue -> aiohue
* Clean up
* Fix config
* Address comments
* Typo
* Fix rebase error
* Mark light as unavailable when bridge is disconnected
* Tests
* Make Throttle work with double delay and async
* Rework update logic
* Don't resolve host to IP
* Clarify comment
* No longer do unnecessary updates
* Add more doc
* Another comment update
* Wrap up tests
* Lint
* Fix tests
* PyLint does not like mix 'n match async and coroutine
* Lint
* Update aiohue to 1.2
* Lint
* Fix await MagicMock
* Make color_name_to_rgb raise
* Add Light Set Color intent
* Move some methods around
* Cleanup
* Prevent 1 more func call
* Make a generic Set intent for light
* Lint
* lint
The module `asyncio.test_utils` has been removed from Python in the 3.7 branch, because it was intended to be a private module for internal testing of asyncio. For more information, see the upstream bug report at https://bugs.python.org/issue32273 and the upstream PR at https://github.com/python/cpython/pull/4785.
For this commit, I have migrated the small amount of functionality that was being used from the `asyncio.test_utils` directly into the `RunThreadsafeTests` Class. To see the original `asyncio.test_utils.TestCase` class, which I pulled some functionality from, please see: https://github.com/python/cpython/blob/3.6/Lib/asyncio/test_utils.py#L440
Note: In addition to being broken in 3.7, this test case also seems to be broken in Python 3.6.4 when using Docker. This PR fixes the test when run in docker.
To reproduce: `./script/test_docker -- tests/util/test_async.py`
failing output (prior to this commit):
```
... trimmed ...
py36 runtests: PYTHONHASHSEED='3262989550'
py36 runtests: commands[0] | py.test --timeout=9 --duration=10 --cov --cov-report= tests/util/test_async.py
Test session starts (platform: linux, Python 3.6.4, pytest 3.3.1, pytest-sugar 0.9.0)
rootdir: /usr/src/app, inifile: setup.cfg
plugins: timeout-1.2.1, sugar-0.9.0, cov-2.5.1, aiohttp-0.3.0
timeout: 9.0s method: signal
―――――――――――――――――― ERROR collecting tests/util/test_async.py ――――――――――――――――――――――――
ImportError while importing test module '/usr/src/app/tests/util/test_async.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/util/test_async.py:3: in <module>
from asyncio import test_utils
/usr/local/lib/python3.6/asyncio/test_utils.py:36: in <module>
from test import support
E ImportError: cannot import name 'support'
```
* Implement adjustment
* Add color support
* fix lint
* Fix lint & use only RGB
* fix HSB + Test
* Add tests & fix bugs
* add rgb test
* add setColorTemperature
* Add color light support + tests
* Fix color temp
* use kelvin for converting
* use correct calculation
* Xiaomi vacuum as component with switch, sensors and services
- Conversion from switch platform to async component.
- Add services proposed in #8416 to the new component, with shorter names.
- Add sensors for the vacuum robot as a selectable list from `battery`, `state`, `error`, `fanspeed`, `clean_time` and `clean_area` (the state attributes of the switch). The sensors don't poll, but listen to a signal to update the state, the switch fires this signal when updating.
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)
* path change in requirements_all (from switch platform to component)
* copy pasting is a bad habit
* services to the components services.yaml, modify .coveragerc
* review: use with multiple hosts, fix calls to async_add_devices, fix ranges for services
* `icon_for_battery_level` util method
* Xiaomi vacuum as platform of new component vacuum
- Created new component `vacuum` from a ToggleEntity.
- Add services `turn_on`, `turn_off`, `cleaning_play_pause`, `stop`, `return_to_base`, `locate`, `set_fanspeed` and `send_command`.
- Remove the main switch for the xiaomi vacuum (the toggable main entity is the switch).
- Add `support flags` for the common services
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)
- Move services descriptions to a yaml file for the new component.
- Update requirements_all.
- Update coveragerc.
* fix coveragerc
* fix battery icon helper to use more icons
* remove sensors, create properties and support flags for custom UI
* cleaning
* updated state_attrs for filtering in UI, renamed platform to simply `xiaomi`
* fix platform rename
* change fanspeed and expose `fanspeed_list` to use speed steps
* minor fixes
- Rename service `start_pause`
- Add 'Error' attribute only if `got_error`.
- Minor changes
* rename state attrs
* rename state attrs
* review changes: cut fan__speed, style changes, remove logging, and more
* add ATTR_COMMAND = 'command' to const
* pop entity_id from service data
* remove property accessor for vacuum object
* lint fix
* fix extra attrs names
* module level functions for calling the services
* params as optional keyword for `send_command`
* params as optional keyword for `send_command`, remove debug logs
* explicit parameters for `set_fan_speed` and `send_command`
* Demo platform for the vacuum component
* vacuum tests for the Demo platform
* some fixes
* don't omit vacuum
* vacuum tests for the Xiaomi platform
* fix test
* fix
* fix xiaomi test
* fix coveragerc
* test send command
* fix coveragerc
* fix string formatting
* The coverage is to low. It need 93% or more
* Use pip install --user if venv not active
* Set PYTHONUSERBASE to deps directory, when installing with --user
option.
* Reset --prefix option to workaround incompatability when installing
with --user option. This requires pip version 8.0.0 or greater.
* Require pip version 8.0.3.
* Do not delete deps directory on home assistant upgrade.
* Fix local lib mount and check package exist.
* Update and add tests
* Fix upgrade from before version 0.46
* Extract function to get user site
* Add function(s) to package util to get user site.
* Use async subprocess for one of the functions to get user site.
* Add function to package util to check if virtual environment is
active.
* Add and update tests.
* Update version for last removal of deps dir
* Address comments
* Rewrite package util tests with pytest
* Rewrite all existing unittest class based tests for package util as
test functions, and capitalize pytest fixtures.
* Add test for installing with target inside venv.
* Add color_util.color_hsv_to_RGB
* Use helper functions for LIFX conversions
The LIFX API uses 16 bits for saturation/brightness while HA uses 8 bits.
Using helper functions makes the conversion a bit nicer and less prone
to off-by-one issues.
The colorsys library uses 0.0-1.0 but we can avoid that by using the HA
color_util converters instead.
This makes more sense because the input and output brightness is the same.
We currently convert through RGB which does contain a brightness so we supply
an arbitrary value as input and discard the output.
* Make Tradfri discoverable
* Fix lint errors
* Fix bugs and clean up calls to light_control
* Add more color util tests
* Add coap client to dockerfile
* After rebase and all fixes
* Added color_rgb_to_hex to util.color
* Added test_color_rgb_to_hex
* Changed reference to color_rgb_to_hex
* Bumped to pytradfri 0.5, having support for retry
* Bumped to pytradfri 0.5, having support for retry
* Bumped to pytradfri 0.5, having support for retry
* Bumped to pytradfri 0.5, having support for retry
* Rolled back to 0.4
* Rolled back to 0.4
* Update to Current RGB D65 Conversion
As per Philips Hue https://developers.meethue.com/documentation/color-conversions-rgb-xy
* Update the source of the XYZ to RGB formulas
* Fix Whitespace
* Update Whitespace
* Update Tests for new Formulas
* Update Tests
* Update XY_Brightness_to_hsv tests
* Update test_color.py
* Fix for OSRAM lights connected to hue bridge
Do not send command "effect = none" to OSRAM lights
Osram lights connected to a hue bridge do not seem to handle "effect =
none" very well. Most of the times they jump to the selected color and
then change to red within a second.
Osram lights connected to a hue bridge do not handle xy values outside
of their gamut. Since they just stay at their old color value, handling
the UI is very unpredictable. Sending HSV values to the lights fixes this.
* Add tests for new util methods