* Added test for temperature fahrenheit
* Restructured tests to use more mocks
* Rearanged homekit constants
* Improved 'test_homekit_class'
* Added import statements
* Fix Pylint Test errors
* 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
* Support TekSavvy Unlimited Plans
Support TekSavvy account usage for unlimited plans.
Seeing cap limit to 0 will now provide unlimited behaviour on usage calculations.
* Add unit tests to sensor.teksavvy
Add coverage unit tests to TekSavvy Sensor component, none existing previously.
* Add support for specifying custom headers for rest_command.
* Added headers configuration to behave similarly to the rest sensor.
* Replaced test_rest_command_content_type which only validated the
configuration with test_rest_command_headers which tests several
combinations of parameters that affect the request headers.
* 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
* 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
* Changed version of "HAP-python" to "v1.1.7"
* Updated acc file to simplify init calls
* Code refactored and '°F' temp Sensors added
* Changed call to 'HomeAccessory' and 'HomeBridge'
* Extended function of 'add_preload_service' to add additional characteristics
* Added function to override characteristic property values
* TemperatureSensor
* Added unit
* Added calc_temperature
* Updated tests
* Fixes for mclimate accounts with not only melissa components
* Fixes melissa sensor to only use HVAC
* Bumping version to 1.0.3 and remove OP_MODE that is not supported
* Removes STATE_AUTO from translation and tests
* [WIP] Allow ignoring call service events
This allows a setting a configuration value (False by default to continue the current behavior) which will ignore call service events.
* extra spaces
removed them
* updates from PR review
* removed print
* update spacing
* updated allowed events to allow for custom events, and included some tests
* hound fixes
* Remove unused constant
* Lint
* Adds folder sensor
The state of the sensor is the time that the most recently modified
file in a folder was modified.
* Address lint errors
* Edit docstrings
Makes the recommended edits to docstrings
* Update .coveragerc
Add sensor/folder.py
* Update folder.py
* Address requests
Address requests changes
* Adds folder
* Adds test, tidy up
* Tidy
* Update test_folder.py
* Update folder.py
* Fix setup
Fix setup with else statement
* Update folder.py
* Update folder.py
* Remove list of files from attributes
* Update test_folder.py
* Update folder.py
* Update test_folder.py
* Update folder.py
* Update folder.py
* Basic Homekit support
* Added Temperatur Sensor
* Added Window Cover
* Code refactored
* Added class HomeAccessory(Accessory)
* Added class HomeBridge(Bridge)
* Changed homekit imports to relative, to enable use in custom_components
* Updated requirements
* Added docs
* Other smaller changes
* Changed Homekit from entity to class
* Changes based on feedback
* Updated config schema
* Add only covers that support set_cover_position
* Addressed comments, updated to pyhap==1.1.5
* For lint: added files to gen_requirements_all
* Added codeowner
* Small change to Wrapper classes
* Moved imports to import_types, small changes
* Small changes, added tests
* Homekit class: removed add_accessory since it's already covered by pyhap
* Added test requirement: HAP-python
* Added test suit for homekit setup and interaction between HA and pyhap
* Added test suit for get_accessories function
* Test bugfix
* Added validate pincode, tests for cover and sensor types
* Rework Sonos media player platform for push
* Ignore play_mode from events where it is missing
* Remove unused preload helper
* Freeze SoCo version
* Updates for entity registry
* Add codeowner
* Use real soco release
It turns out I misunderstood which media_player services are available
when a media player supports StepVolume. This PR maps the Alexa
StepSpeaker messages to the volume_up and volume_down services.
Currently Alexa allows you to specify the number of steps but the media
player volume_up and volume_down services don't support this. For now I
just look to see if the steps are +/- and call up/down accordingly.
* 🐎 Async WUnderground
* ∞ Them lines be too long
* Fix pylint warnings
* Changes according to comments
* Remove STATE_UNKNOWN
* 🔬 Fix tests
* Improve tests
* Upgrade pylint to 1.8.1
* Fix no-else-return
* Fix bad-whitespace
* Fix too-many-nested-blocks
* Fix raising-format-tuple
See https://github.com/PyCQA/pylint/blob/master/doc/whatsnew/1.8.rst
* Fix len-as-condition
* Fix logging-not-lazy
Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string
* Fix stop-iteration-return
* Fix useless-super-delegation
* Fix trailing-comma-tuple
Both of these seem to simply be bugs:
* Nest: The value of self._humidity never seems to be used anywhere
* Dovado: The called API method seems to expect a "normal" number
* Fix redefined-argument-from-local
* Fix consider-using-enumerate
* Fix wrong-import-order
* Fix arguments-differ
* Fix missed no-else-return
* Fix no-member and related
* Fix signatures-differ
* Revert "Upgrade pylint to 1.8.1"
This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.
* Fix arguments-differ
* except for device_tracker
* Cleanup
* Fix test using positional argument
* Fix line too long
I forgot to run flake8 - shame on me... 🙃
* Fix bad-option-value for 1.6.5
* Fix arguments-differ for device_tracker
* Upgrade pylint to 1.8.2
* 👕 Fix missed no-member
* Fix MQTT retained message not being re-dispatched
* Fix tests
* Use paho-mqtt for retained messages
* Improve code style
* Store list of subscribers
* Fix lint error
* Adhere to Home Assistant's logging standard
"Try to avoid brackets and additional quotes around the output to make it easier for users to parse the log."
- https://home-assistant.io/developers/development_guidelines/
* Add reconnect tests
* Fix lint error
* Introduce Subscription
Tests still need to be updated
* Use namedtuple for MQTT messages
... And fix issues
Accessing the config manually at runtime isn't ideal
* Fix MQTT __init__.py tests
* Updated usage of Mocks
* Moved tests that were testing subscriptions out of the MQTTComponent test, because of how mock.patch was used
* Adjusted the remaining tests for the MQTT clients new behavior - e.g. self.progress was removed
* Updated the async_fire_mqtt_message helper
* ✅ Update MQTT tests
* Re-introduce the MQTT subscriptions through the dispatcher for tests - quite ugly though... 🚧
* Update fixtures to use our new MQTT mock 🎨
* 📝 Update base code according to comments
* 🔨 Adjust MQTT test base
* 🔨 Update other MQTT tests
* 🍎 Fix carriage return in source files
Apparently test_mqtt_json.py and test_mqtt_template.py were written on Windows. In order to not mess up the diff, I'll just redo the carriage return.
* 🎨 Remove unused import
* 📝 Remove fire_mqtt_client_message
* 🐛 Fix using python 3.6 method
What's very interesting is that 3.4 didn't fail on travis...
* 🐛 Fix using assert directly
* Attempt fixing check_config script test flakiness
* Fix logging
* remove cleanup as Python will exit
* Make sure we don't enqueue magicmocks
* Lint
* Reinstate cleanup as it broke secret tests
* Add a processing queue to influxdb
* Updates after reviews
* Remove lint
* Move retry loop to thread class
* Move constant calculation out of loop
* Deprecate retry_queue_limit
* Simplify entity update
* Split entity platform from entity component
* Decouple entity platform from entity component
* Always include unit of measurement again
* Lint
* Fix test
* fix generic_thermostat bug when restore state from HA start up
if you don't set "initial_operation_mode" in config, you will get
`self._enabled = True` when init GenericThermostat. And then you will
miss the `if self._current_operation != STATE_OFF` statement and the
self._enabled still keep `True`. That's the problem
* add a test to describe the restore case
* make port mapping optional
* dependencies + improvements
* Added bytes and packets sensors from IGD
* flake8 check
* new sensor with upnp counters
* checks
* whitespaces in blank line
* requirements update
* added sensor.upnp to .coveragerc
* downgrade miniupnpc
Latest version of miniupnpc is 2.0, but pypi only has 1.9
Fortunately it is enough
* revert to non async
miniupnpc will do network calls, so this component can’t be moved to
coroutine
* hof hof
forgot to remove import ot asyncio
* Add baudrate option
* merge
* Added Mediaroom media_player component
* Updated header
Works with MEO and VDF set-top boxes in Portugal
* formatting
* Development Checklist (done)
* fix formatting according to houndci-bot
* more format fixing (tks houndci-bot)
* more fixes
* too much cleanup...
* too much
* pylint check
* Initial commit
Basic configuration testing
* flake8 and 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'
```
* Fixing demo platform to use support_flags
* Fixed tests as well
* Moved humidity low / high as always available based on defaults
* Updated demo platform to show more combinations
* 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…
* google_assistant: Refactor query_device
The previous code had issues where domains could break out and end up
with weird brightness values and we weren't enforcing the `on` and
`oneline` keys in the response.
* google_assistant: Add media_player to query test
* Refactor alexa smart_home tests
The previous tests had a lot of copy pasta due to a lack of expressions
for higher-level assertions. I'm hoping this makes it more reasonable to
extend all interfaces to support properties.
* Lint
* Refactor Alexa Smart Home API
Having an object per interface will make it easier to support
properties.
Ideally, properties are reported in context in all responses. However
current implementation reports them only in response to a ReportState
request. This seems to work sufficiently. As long as the device is
opened in the Alexa app, Amazon will poll the device state every few
seconds with a ReportState request.
* Report properties for some Alexa interfaces
Fixes (mostly) #11874.
Other interfaces will need properties implemented as well.
Implementing properties for just PowerController seems sufficient to
eliminate the "There was a problem." error for any device that supports
it, even if other interfaces are supported. Of course the additional
properties will be reported incorrectly in the Alexa app.
Includes a minor bugfix: `reportable` was previously placed incorrectly
in the responses, so Amazon was ignoring it.
Having an object per interface will make it easier to support
properties.
Ideally, properties are reported in context in all responses. However
current implementation reports them only in response to a ReportState
request. This seems to work sufficiently. As long as the device is
opened in the Alexa app, Amazon will poll the device state every few
seconds with a ReportState request.
* Fixed Canary temperature sensor and remapped air quality value
* Addressed review comment
* - Fixed canary tests and added more tests
- Removed py-canary requirements from tests
* Noop to trigger a build again
* - Removed py-canary requirements from tests
* Addressed PR comment
* - Updated tests
- Removed py-canary from gen_requirements_all.py
* - Fixed hound violation
* Added back py-canary to gen_requirements_all.py as it's still need in tests
* Added back py-canary to test requirements as it's still need in tests
* Address PR comment
* Send Alexa Smart Home responses to debug log
* Report scripts and groups as scenes to Alexa
The Alexa API docs have a couple display categories that sound relevant
to scenes or scripts:
ACTIVITY_TRIGGER: Describes a combination of devices set to a
specific state, when the state change must occur in a specific
order. For example, a “watch Neflix” scene might require the: 1. TV
to be powered on & 2. Input set to HDMI1.
SCENE_TRIGGER: Describes a combination of devices set to a specific
state, when the order of the state change is not important. For
example a bedtime scene might include turning off lights and
lowering the thermostat, but the order is unimportant.
Additionally, Alexa has a notion of scenes that support deactivation.
This is a natural fit for groups, and scripts with delays which can be
cancelled.
https://developer.amazon.com/docs/device-apis/alexa-discovery.html#display-categories
The mechanism to map entities to the Alexa Discovery response is
refactored since extending the data structures in MAPPING_COMPONENT to
implement supportsDeactivation would have added complication to what I
already found to be a confusing construct.
* Release worker thread while waiting for Z-wave startup
* Increase zwave startup timeout
* Adjust test
* Use asyncio.sleep in _check_awaked
* Remove lint
* Name loop parameter
* Expose Alexa Smart Home via HTTP POST
Haaska uses the deprecated v2 Alexa Smart Home payload. Exposing the v3
implementation this way allows an easy path to upgrading Haaska and
reducing code duplication with Home Assistant Cloud.
* Expose Alexa Smart Home via HTTP POST
Haaska uses the deprecated v2 Alexa Smart Home payload. Exposing the v3
implementation this way allows an easy path to upgrading Haaska and
reducing code duplication with Home Assistant Cloud.
In local testing py36 always fails on test_minimal_config on a wait
call that never completes. One difference between this test and others
in the class is the lack of a mock on `call`. With this added, the
test passes locally 100%.
* Allow exposing sensors as temperature or humidity as 'climate' to Google Assistant
* Fixed hound
* Fixed hound
* Handled correctly unit of measurement to fix humidity
* Fixed temperature conversion for Google climate components
* Fixed temperature conversion for Google climate components
* Fixed indentation
* Fixed hound
* Fixed tests
* Fixed conversion and unit tests
* Fix sync for custom unit temperature
* Implemented requested changes
* Fix hound
* Fix linting errors
* Added success tests for sensors as climate
* Fix lint errors
* Change 'on' to 'heat' as fallback thermostat mode
'on' isn't recognised as a mode by Google Assistant, rather is used as a method to return a thermostat to a previous mode. In the case where a thermostat doesn't support the standard google modes (e.g. A homematic radiator thermostat) this means the set_temperature doesn't get returned to the user on a request.
* Update test_google_assistant.py
* Make Google TTS secure
I noticed that my TTS queries were showing up in the log on my router, so I was curious if there was a way to make it secure. A quick search showed people using https instead of http (https://stackoverflow.com/questions/32053442/google-translate-tts-api-blocked), so I figure that should work. I am using hass.io, so I'm not actually sure how to test this, but its a pretty simple change.
* Fix the tts test.
* Added option to create a group for the plant and all of it's sensors so that they appear together in the UI
* fixed warnings from the hound
* added check for min_brightness over several days
* fixed hound complaints
* 1) added missing dependency on recorder
2) using group.Group instead of hass.states.async_set as requested by @pvizeli
* fixed pylint error in docstring
* changed the way the groups are created
* fixed requirements issue
* Changed the way the groups are implemented. This is proposal number 4...
* Data read from recorder only on startup.
We now only store one data point per day. If a recorder is configured, this data is initialized from the database. If not the list is empty on startup.
* added missing documentation
* fixed typo in comment
* removed group fature
* added group dependency since it's still needed
* fixed bug: now "None" is no longer added to the DailyHistory
* now also outputting unit of measurement if defined by the sensors
* removed iconss
* fixed line length
* Implemented changes requested in code reviews.
These changes affect the interface to the UI:
* renamed attribute for units of measurement to "unit_of_measurement_dict"
* renamed attribute for maximum in brightness history to "max_brightness"
* only loading the history if a brightness sensor was configured
* fixed testcase
* fixed stupid bug in check of brightness history
Also added test for this bug
* added missing docstring
* Fixed sporadic failure in test case.
Sometimes the component was created before the data was stored in the history. This lead to an empty history being read.
* removed unused import statement in testcase
* reverted change to test case
* Changed startup behavior of the component.
No failed tests after 20 local test runs.
* added missing docstring
* fixed tests
* added hass.start() to Setup
* fixed call parameters in constructor
* added time.sleep
* removed sleep
* fixed typo in variable name
* disabled loading from database as it's not stable at the moment and nobody knows why :(
* fixed flake8
* now using pytest.mark.skipif to skip 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
* Add 'last' type to min/max sensor
Now supports types: min, max, mean, last
'last' is the most recently received value from all tracked entities.
* Min/max sensor 'last' type test
* Fix min/max sensor 'last' test
* Use bluetooth_le source_type, if location was changed by beacon
* No reason to do nested ifs
* Added tests for source_type on owntracks
* Fixed The Hound
* Added test and fixed bug surfaced by test
* Added snips.say and snips.say_action services
* Added snips.say and snips.say_action services
* Merged services.yaml changes I missed
* added tests for new service configs
* Woof
* Woof Woof
* Changed attribute names to follow hass standards.
* updated test_snips with new attribute names
* 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
* Changed device type of media player and cover to switch
Covers and media players should not be of device type 'light'. Example: If user requests all lights to switch to off, covers are closed and media players are affected too.
* Fix 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
* Connection to mochad occasionally stalls on RPi and CM19A. Reconnect one switch send command.
* Formatting and exception hanling fixes
* Moved import inside the method. Logging outside the try-catch.
* Tailing whitespaces.
* MockDependency on pymochad in unit tests to resolve exceptions
* patch pymochad MochadException in unit tests to resolve exceptions
* patch pymochad MochadException in unit tests to resolve exceptions
* cleaned unused import
* lint issue fixed
* pylint issue fixed
* New features for Owntracks device_tracker
- Supporting a mapping of region names in OT to zones in HA, allowing
separate namespaces in both applications. This is especially helpful
if using one OT instance to update geofences for multiple homes.
- Creating a setting to ignore all location updates, allowing users to
rely completely on enter and leave events. I have personally always
used OT integrations with home automation this way and find it the
most reliable.
- Allowing the OT topic to be overridden in configuration
* Fixing configuration of MQTT topic, related tests
* Tests for Owntracks events_only feature
* Tests for customizing mqtt topic, region mapping
* Fixing _parse and http for owntracks custom topic
* Making tests more thorough and cleaning up lint
* 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
* Fix time functions would throw errors in python scripts
* Added unit test for time.strptime, change variable name to satisfy lint
* Added docstring for time attribute wrapper method to satisfy lint
* Fixed line too long lint problem
* Don't duplicate html5 registrations
If a registration is posted and another registration with the same
endpoint URL exists, update that one instead. That way, we preserve
the device name that has been configured. The previous behavior used to
append 'unnamed device' registrations over and over, leading to
multiple copies of the same registration. The endpoint URL is unique per
service worker so it is safe to update matching registrations.
* Refactor html5 registration view to not write json in the event loop
* Updated generic thermostat to respect operation_mode and added away mode
* Updated tests to include away mode and corrected init problem for sensor state
Added more tests to improve coverage and corrected again lint errors
Fixed new test by moving to correct package
Fixed bug not restoring away mode on restart
* Added support for idle on interface through state
* Added back initial_operation_mode and modified away_temp to be only one for now
* Fixed houndci-bot errors
* Added back check for None on restore temperature
* Fixed failing tests as well
* Removed unused definitions from tests
* Added use case for no initial temperature and no previously saved temperature