The `Config` object specific to the `google_assistant` component
had a default value for `allow_unlock`. We were not overriding this
default when constructing the Config object during `google_assistant`
component setup, whereas we do when setting up the `cloud` component.
To fix, we thread the `allow_unlock` parameter down through http setup,
and ensure that it's set correctly. Moreover, we also change the
ordering of the `Config` parameters, and remove the default. Future
refactoring should not miss it, as it is now a required parameter.
* added additional filters
Added base64_encode, base64_decode and ordinal filters.
* added test cases
added test cases for base64_encode, base64_decode and ordinal filters.
* forgot to add filters :)
* Create test for platform
Created test for platform.
Added media_stop to common.py test
* Multiple improvements
Fixed lint issue in common.py
Fixed lint issues in test_directv.py
Improved patching import using modile_patcher.start() and stop()
Added asserts for service calls.
* Updates based on Martin's review
Updates based on Martin's review.
* Updated test based on PR#18474
Updated test to use service play_media instead of select_source based on change from PR18474
* Lint issues
Lint issues
* Further updates based on feedback
Updates based on feedback provided.
* Using async_load_platform for discovery test
Using async_load_platform for discovery tests.
Added asserts to ensure entities are created with correct names.
* Used HASS event_loop to setup component
Use HASS event_loop to setup the component async.
* Updated to use state machine for # entities
Updated to use state machine to count # entities instead of entities.
* Use hass.loop instead of getting current loop
Small update to use hass.loop instead, thanks Martin!
* Forgot to remove asyncio
Removed asyncio import.
* Added fixtures
Added fixtures.
* Remove not needed updates and assertions
* Return mocked dtv instance from side_effect
* Fix return correct fixture instance
* Clean up assertions
* Fix remaining patches
* Mock time when setting up component in fixture
* Patch time correctly
* Attribute _last_update should return utcnow
* Added Entur departure information sensor.
* Fixed houndci-bot comments.
* Removed tailing whitespace.
* Fixed some comments from tox lint.
* Improved docstring, i think.
* Fix for C1801
* Unit test for entur platform setup
* Rewritten entur component to have pypi dependecy.
* Propper client id for api usage.
* Minor cleanup of usage of constants.
* Made location output configurable.
* Cleaned up usage of constants.
* Moved logic to be contained within setup or update methods.
* Moved icon consts to root in module.
* Using config directly in test
* Minor changes
* Store state last seen time separately
This ensures that infrequently updated entities aren't accidentally
dropped from the restore states store
* Fix mock restore cache
* Add support for Mode trait in Google Assistant.
* Simplify supported logic.
* Fix SUPPORTED_MODE_SETTINGS to correct rip failures.
* more stray commas
* update tests.
* Fix statistics for binary sensor
-) Binary sensors have 'on' and 'off' for state resulting in issue as numbers were expected. Fixed so that it works with non-numeric states as well.
-) Added check to skip unknown states.
-) Updates test so that binary sensor test will use non-numeric values for states.
* Using guard clause and changed debug to error
Changed to use a guard clause for state unknown.
Writing error on value error instead of debug.
* Add docstring
* 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
* Enable Google Assistant OnOffTrait for climate devices that support them
This commit enables the OnOffTrait for climate devices that have the SUPPORT_ON_OFF feature. I have tested this locally with a Sensibo device which supports ON_OFF and a nest device that does not.
* Update trait.py
* Add tests for onoff_climate
* Add OnOff trait to climate.heatpump
* Add on status to heatpump in google_assistant tests
* code cleanup to make use of new externalised feed manager
* fixed lint
* revert change, keep asynctest
* using asynctest
* changed unit test from mocking to inspecting dispatcher signals
* code clean-up
* 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
* Add permission checks to Rest API
* Clean up unnecessary method
* Remove all the tuple stuff from entity check
* Simplify perms
* Correct param name for owner permission
* Hass.io make/update user to be admin
* Types
* Awair Sensor Platform
This commit adds a sensor platform for Awair devices, by accessing
their beta API. Awair heavily rate-limits this API, so we throttle
updates based on the number of devices found. We also allow for the
user to bypass API device listing entirely, because the device list
endpoint is limited to only 6 calls per day. A crashing or restarting
server would quickly hit that limit.
This sensor platform uses the python_awair library (also written
as part of this PR), which is available for async usage.
* Disable pylint warning for broad try/catch
It's true that this is generally not a great idea, but we really don't
want to crash here. If we can't set up the platform, logging it and
continuing is the right answer.
* Add space to satisfy the linter
* Awair platform PR feedback
- Bump python_awair to 0.0.2, which has support for more granular exceptions
- Ensure we have python_awair available in test
- Raise PlatformNotReady if we can't set up Awair
- Make the 'Awair score' its own sensor, rather than exposing it other ways
- Set the platform up as polling, and set a sensible default
- Pass in throttling parameters to the underlying data class, rather
than use hacky global variable access to dynamically set the interval
- Switch to dict access for required variables
- Use pytest coroutines, set up components via async_setup_component,
and test/modify/assert in generally better ways
- Commit test data as fixtures
* Awair PR feedback, volume 2
- Don't force updates in test, instead modify time itself and let
homeassistant update things "normally".
- Remove unneeded polling attribute
- Rename timestamp attribute to 'last_api_update', to better reflect
that it is the timestamp of the last time the Awair API servers
received data from this device.
- Use that attribute to flag the component as unavailable when data
is stale. My own Awair device periodically goes offline and it really
hardly indicates that at all.
- Dynamically set fixture timestamps to the test run utcnow() value,
so that we don't have to worry about ancient timestamps in tests
blowing up down the line.
- Don't assert on entities directly, for the most part. Find desired
attributes in ... the attributes dict.
* Patch an instance of utcnow I overlooked
* Switch to using a context manager for timestream modification
Honestly, it's just a lot easier to keep track of patches. Moreover,
the ones I seem to have missed are now caught, and tests seem to
consistently pass.
Also, switch test_throttle_async_update to manipulating time more
explicitly.
* Missing blank line, thank you hound
* Fix pydocstyle error
I very much need to set up a script to do this quickly w/o tox, because
running flake8 is not enough!
* PR feedback
* PR feedback