* Adding new feature to allow a wait template to run the remainer of the script on timeout
* Styling changes
* Fixing file permissions, adding test for new code
* changed variable name, refactored script to pass information into async_set_timeout
* Changing the default behaviour to continue to run the script after timeout
* Refactoring data_entry_flow and config_entry_flow
Move SOURCE_* to config_entries
Change data_entry_flow.FlowManager.async_init() source param default
to None
Change this first step_id as source or init if source is None
_BaseFlowManagerView pass in SOURCE_USER as default source
* First step of data entry flow decided by _async_create_flow() now
* Lint
* Change helpers.config_entry_flow.DiscoveryFlowHandler default step
* Change FlowManager.async_init source param to context dict param
## 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**
* Add storage helper
* Migrate config entries to use the storage helper
* Make sure tests do not do I/O
* Lint
* Add versions to stored data
* Add more instance variables
* Make migrator load config if nothing to migrate
* Address comments
* Add first version of the Matrix bot
* It's a stupid but necessary change…
* Dont list it twice
* All hail the linter!
* More linter-pleasing
* Use the correct user ID
* Add expression commands
* Add tests for new validators
* Fix room alias handling
* Wording
* Defer setup
* Simplify commands
* Handle exceptions
* Update requirements
* Review
* Move login back to constructor
* Fix review comments
* Adds template function state_attr to get attribute from a state
Refactored is_state_attr to use new function
Adds tests for state_attr
* Fixes line too long and test bug
* Fixes pylint error
* Fixes tests and D401 lint error
* 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
* Add view to support backend translation fetching
* Load backend translations from component json
* Translations for season sensor
* Scripts to merge and unpack Lokalise translations
* Fix copy paste error
* Serve post-lokalise translations to frontend
* Linting
* Auto-deploy translations with Travis
* Commit post-lokalise translation files
* Split logic into more helper functions
* Fall back to English for missing keys
* Move local translation copies to `.translations`
* Linting
* Initial tests
* Remove unnecessary file check
* Convert translation helper to async/await
* Convert translation helper tests to async/await
* Use set subtraction to find missing_components
* load_translation_files use component->file mapping
* Remove duplicated resources fetching
Get to take advantage of the slick Python 3.5 dict merging here.
* Switch to live project ID
* Added cv.EntitiesDoamin(domain) validator
* Check if all entities in string or list belong to domain
* Added tests
* Use factory function and entity_ids
* Different error message
* Typo
* Added entity_domain validator for a single entity_id
* Image_processing platform now uses cv.entity_domain for source validation
* Simplify entity update
* Split entity platform from entity component
* Decouple entity platform from entity component
* Always include unit of measurement again
* Lint
* Fix test
* Entity#unique_id defaults to None
* Initial commit entity registry
* Clean up unique_id property
* Lint
* Add tests to entity component
* Lint
* Restore some unique ids
* Spelling
* Remove use of IP address for unique ID
* Add tests
* Add tests
* Fix tests
* Add some docs
* Add one more test
* Fix new test…
* Implemented event_data_template
* The hound does not like my indentation
* Added passed variables to tests for event and svc template calls
* Moved recursive function to template.py
* Update template.py
* Update template.py
* Cleaned up service.py and fixed unit tests
* Blank lines
* Removed stray logger statement
* Blank lines again
* Fix error when name is non-latin script
When the name is non-latin script (e.g. Japanese), slugify returns empty string and causes failure in a later stage. This commit fixes the issue by using default name.
* Add test
* Deprecate explicit entity_id in template platforms
* Use config validator for deprecation
* Fix copy/paste typos
* Also print the config value
* Add test for config validator
* Assert the module name that logged the message
* Lazy loading of service descriptions
* Fix tests
* Load YAML in executor
* Return a copy of available services to allow mutations
* Remove lint
* Add zha/services.yaml
* Only cache descriptions for known services
* Remove lint
* Remove description loading during service registration
* Remove description parameter from async_register
* Test async_get_all_descriptions
* Remove lint
* Fix typos from multi-edit
* Remove unused arguments
* Remove unused import os
* Remove unused import os, part 2
* Remove unneeded coroutine decorator
* Only use executor for loading files
* Cleanups suggested in review
* Increase test coverage
* Fix races in existing tests
* Add support for logarithm in templates
This adds a 'log' filter that takes the logarithm of the given value,
with an optional base number. The base defaults to 'e' - the natural
logarithm
* Remove usage of log10 in template filter 'log'
* Add logarithm as a global
This makes it possible to write:
'{{ log(4, 2) }}'
* Add EntityFilter helper
* Changes in entityfilter after code review
* Convert recorder to use EntityFilter
* Fix flake/lint errors in recorder
* Update entity filter helper to return function
* Update recorder to use updated entity filter
* Better docstrings in entityfilter
* Update entityfilter.py
* * Rename input_slider to input_number
* Update input_number to optionally display slider, input box, or both
* input_number support either input box or slider mode, but not both
* input_number : change service from select_value to set_value
* input_number : add test for mode setting to tests
* Initial proposal for the input_datetime
* Linting
* Further linting, don't define time validation twice
* Make pylint *and* flake8 happy at the same time
* Move todos to the PR to make lint happy
* Actually validate the type of date/time
* First testing
* Linting
* Address code review issues
* Code review: Remove forgotten print()s
* Make set_datetime a coroutine
* Create contains_at_least_one_key_value CV method, use it
* Add timestamp to the attributes
* Test and fix corner case where restore data is bogus
* Add FIXME
* Fix date/time setting
* Fix Validation
* Merge date / time validation, add tests
* Simplify service data validation
* No default for initial state, allow 'unknown' as state
* cleanup
* fix schema
Prometheus (https://prometheus.io/) is an open source metric and alerting
system. This adds support for exporting some metrics to Prometheus, using
its Python client library.
* Refactor sun component for correctness
* Convert datetimes to dates for astral
* Fix tests for updated code
* Fix times now that calcs are fixed
* Move sun functions to helpers
* Fix flake on new file
* Additional tweaks from review
* Update requirements
* Always return True/False from is_state and is_state_attr
These functions are documented to always return True/False but the
short-circuit evaluation would return None if the entity_id did not exist.
* Reword into a single statement
* Restore states
* feedback
* Remove component move into recorder
* space
* helper
* Address my own comments
* Improve test coverage
* Add test for light restore state
* Core cleanup: two stage shutdown
* fix spell
* fix
* add async logger to close
* change aiohttp to use CLOSE
* address paulus comments
* Fix tests
* Add unittest
* Update scan_interval and interval_seconds max to 1 day vs. 60 seconds
* Format fixes
* Add docstring on unittest.
* Added and implemented new async_track_time_interval helper.
* Format fixes, removed unused import.
* Undid whoops on unsub_polling.
* Updated unit tests for scan_interval.
* Added unit test for track_time_interval.
* Allow other forms of time interval input for scan_interval and interval_seconds
This commit adds a new component for communicating with mochad[1] a
socket interface for the CM15A and CM19A USB X10 controllers. This
commit leverages the pymochad library to interface with a mochad socket
either on a local or remote machine. Mochad is added as as a generic
platform because it supports multiple different classes of device,
however in this patch only the switch device implemented as a starting
point. Future patches will include other devices types. (although
that's dependent on someone gaining access to those)
[1] https://sourceforge.net/projects/mochad/
* Adds support for Pioneer AVR interface port number
https://community.home-assistant.io/t/support-for-pioneer-avr/503
telnetlib supports a port number so adding port as
an optional config element with a default of 23 resolves this.
* Adds timeout to Pioneer AVR
timeout in telnetlib defaults to socket._GLOBAL_DEFAULT_TIMEOUT
which is not a value, but rather a bare Object used for comparison.
telnetlib says the following about the timeout optional argument:
"The optional timeout parameter specifies a timeout in seconds
for blocking operations like the connection attempt (if not
specified, the global default timeout setting will be used)."
From the documentation for sockets:
"Sockets are by default always created in blocking mode"
Catching connect and timeout errors, logging to debug
and continuing.
* Catches timeout exceptions, logs and continues.
* first version
* First draft component entities
* Change add_entities to callback from coroutine
* Fix bug add async_prepare_reload
* Group draft v1
* group async
* bugfix
* bugfix v2
* fix lint
* fix extract_entity_ids
* fix other things
* move get_component out of executor
* bugfix
* Address minor changes
* lint
* bugfix - should work now
* make group init async only
* change update handling to old stuff
* fix group handling, remove generator from init
* fix lint
* protect loop for spaming with updates
* fix lint
* update test_group
* fix
* update group handling
* fix __init__ async trouble
* move device_tracker to new layout
* lint
* fix group unittest
* Test with coroutine
* fix bug
* now it works 💯
* ups
* first part of suggestion
* add_entities to coroutine
* change group
* convert add async_add_entity to coroutine
* fix unit tests
* fix lint
* fix lint part 2
* fix wrong import delete
* change async_update_tracked_entity_ids to coroutine
* fix
* revert last change
* fix unittest entity id
* fix unittest
* fix unittest
* fix unittest entity_component
* fix group
* fix group_test
* try part 2 to fix test_group
* fix all entity_component
* rename _process_config
* Change Group to init with factory
* fix lint
* fix lint
* fix callback
* Tweak entity component and group
* More fixes
* Final fixes
* No longer needed blocks
* Address @bbangert comments
* Add test for group.stop
* More callbacks for automation
* Cache condition in helpers.Script
The caching is a simple in-memory, per-instance dictionary.
We use __str__ to format cache keys.
This naive implementation has some disadvantages (e.g., we won't be able
to cache two conditions that contain references to
distinct-but-equivalent object instances and we don't have any control
over the size of the condition cache), but for most simple use-cases the
approach should be good enough.
Resolves#3629
* Fix docstring style
* Add async_safe annotation
* More async_run_job
* coroutine -> async_save
* Lint
* Rename async_safe -> callback
* Add tests to core for different job types
* Add one more test with different type of callbacks
* Fix typing signature for callback methods
* Fix callback service executed method
* Fix method signatures for callback
* Add event loop to the core
* Add block_till_done to HA core object
* Fix some tests
* Linting core
* Fix statemachine tests
* Core test fixes
* fix block_till_done to wait for loop and queue to empty
* fix test_core for passing, and correct start/stop/block_till_done
* Fix remote tests
* Fix tests: block_till_done
* Fix linting
* Fix more tests
* Fix final linting
* Fix remote test
* remove unnecessary import
* reduce sleep to avoid slowing down the tests excessively
* fix remaining tests to wait for non-threadsafe operations
* Add async_ doc strings for event loop / coroutine info
* Fix command line test to block for the right timeout
* Fix py3.4.2 loop var access
* Fix SERVICE_CALL_LIMIT being in effect for other tests
* Fix lint errors
* Fix lint error with proper placement
* Fix slave start to not start a timer
* Add asyncio compatible listeners.
* Increase min Python version to 3.4.2
* Move async backports to util
* Add backported async tests
* Fix linting
* Simplify Python version check
* Fix lint
* Remove unneeded try/except and queue listener appproriately.
* Fix tuple vs. list unorderable error on version compare.
* Fix version tests
Add unit symbol constants
Initial unit system object
Import more constants
Pydoc for unit system file
Import constants for configuration validation
Unit system validation method
Typing for constants
Inches are valid lengths too
Typings
Change base class to dict - needed for remote api call serialization
Validation
Use dictionary keys
Defined unit systems
Update location util to use metric instead of us fahrenheit
Update constant imports
Import defined unit systems
Update configuration to use unit system
Update schema to use unit system
Update constants
Add imports to core for unit system and distance
Type for config
Default unit system
Convert distance from HASS instance
Update temperature conversion to use unit system
Update temperature conversion
Set unit system based on configuration
Set info unit system
Return unit system dictionary with config dictionary
Auto discover unit system
Update location test for use metric
Update forecast unit system
Update mold indicator unit system
Update thermostat unit system
Update thermostat demo test
Unit tests around unit system
Update test common hass configuration
Update configuration unit tests
There should always be a unit system!
Update core unit tests
Constants typing
Linting issues
Remove unused import
Update fitbit sensor to use application unit system
Update google travel time to use application unit system
Update configuration example
Update dht sensor
Update DHT temperature conversion to use the utility function
Update swagger config
Update my sensors metric flag
Update hvac component temperature conversion
HVAC conversion for temperature
Pull unit from sensor type map
Pull unit from sensor type map
Update the temper sensor unit
Update yWeather sensor unit
Update hvac demo unit test
Set unit test config unit system to metric
Use hass unit system length for default in proximity
Use the name of the system instead of temperature
Use constants from const
Unused import
Forecasted temperature
Fix calculation in case furthest distance is greater than 1000000 units
Remove unneeded constants
Set default length to km or miles
Use constants
Linting doesn't like importing just for typing
Fix reference
Test is expecting meters - set config to meters
Use constant
Use constant
PyDoc for unit test
Should be not in
Rename to units
Change unit system to be an object - not a dictionary
Return tuple in conversion
Move convert to temperature util
Temperature conversion is now in unit system
Update imports
Rename to units
Units is now an object
Use temperature util conversion
Unit system is now an object
Validate and convert unit system config
Return the scalar value in template distance
Test is expecting meters
Update unit tests around unit system
Distance util returns tuple
Fix location info test
Set units
Update unit tests
Convert distance
DOH
Pull out the scalar from the vector
Linting
I really hate python linting
Linting again
BLARG
Unit test documentation
Unit test around is metric flag
Break ternary statement into if/else blocks
Don't use dictionary - use members
is metric flag
Rename constants
Use is metric flag
Move constants to CONST file
Move to const file
Raise error if unit is not expected
Typing
No need to return unit since only performing conversion if it can work
Use constants
Line wrapping
Raise error if invalid value
Remove subscripts from conversion as they are no longer returned as tuples
No longer tuples
No longer tuples
Check for numeric type
Fix string format to use correct variable
Typing
Assert errors raised
Remove subscript
Only convert temperature if we know the unit
If no unit of measurement set - default to HASS config
Convert only if we know the unit
Remove subscription
Fix not in clause
Linting fixes
Wants a boolean
Clearer if-block
Check if the key is in the config first
Missed a couple expecting tuples
Backwards compatibility
No like-y ternary!
Error handling around state setting
Pretty unit system configuration validation
More tuple crap
Use is metric flag
Error handling around min/max temp
Explode if no unit
Pull unit from config
Celsius has a decimal
Unused import
Check if it's a temperature before we try to convert it to a temperature
Linting says too many statements - combine lat/long in a fairly reasonable manner
Backwards compatibility unit test
Better doc
* Allow time condition windows to cross midnight.
* Address comments.
Fold _in_time_window back into the time() condition test.
Use specific time values to test the time window.
* Add tests to reach full coverage for helpers/state.py.
* Refactor reproduce_state function in helpers/state.py. Add two dicts,
as global constants, service_attributes and service_to_state. Use
these in combination with the dict of services per domain from
ServiceRegistry, to find the correct service to use in a scene state
change.
* Use break statement in for loop, to break if service was selected
to update state, in preference to update state attributes, ie state
update takes precedence.
* Add ATTR_CODE and ATTR_CODE_FORMAT in const. Import these in
alarm_control_panel and lock platforms instead of making duplicate
constants in multiple modules.
* Use ATTR_MEDIA_CONTENT_TYPE and ATTR_MEDIA_CONTENT_ID in media_player
platform in SERVICE_PLAY_MEDIA and play_media methods, instead of
'media_type' and 'media_id'.
* Fix PEP257 in modified files.
This adds state_as_number(), a helper method that tries to interpret
state as a number, for cases we can predict. It's a generalization of
what is copy-and-paste-ed into multiple other places.