* 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
* Base platform in place
* Logic in place
* Requirements and coverage
* Fixed some linting issues
* Small attribute reorganization
* Collaborator-requested changes round 1
* Updated documentation
* 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.
* Multi-Room Support for Greenwave Reality
* PEP8 Line Too Long
* Update requirements_all.txt
* Shared State Object
Shared State Object added, and implemented new function of greenwavereality to abstract complex runtimes.
* Update requirements_all.txt
* Lint issues
* Rewrite method to not trigger "Method could be a function"
* Remove unnecessary arguments for update call
* Improve foscam library exception support
Catches foscam exceptions that otherwise pollute the log. Many of these exception can safely be ignored
* Fixed line length
Fixed line length
* Changed exception and log handling
changed logging and catched only the TypeError effecting the library
* Removed unused var
Removed var
* Fix remaining issue
* worked on first version of IOTA wallet
* added sensor for IRI node
* added requirements
* ignored new component in test coverage
* changed length of line
* fixed linter issues
* changed requested changes
* moved attributes of IRI node
* change coverage definitions
* changed loading of platforms
* changed loading of platforms
* changed initial state of wallet sensor
* changed handling of config
* changed attribute handling for IOTA node sensor
* Follow the component style
* Fix ordering and docstring
* Fix pylint issue
* New venstar climate component
* Corrected items raised during the PR process.
* Corrected flak8 issues.
* Add support for venstar models without humidity control.
* Changed the idle operation mode to off. Few other adjustments.
* Minor changes (log messages, sorting, etc.)
* Added documentation reference to code
* Some code clean-ups suggested by @MartinHjelmare in PR#: 11695 after merging.
* fixed minor typo in docstring
* fixed another minor typo in same docstring...
* fixed another minor typo in same docstring...
* 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.
* added unavailability tracker, updated sensor component
* change hass argument position according to position in binary_sensor
* added hass argument to binary_sensor, updated is_on(), it can be UNAVAILABLE now
* updated switch component to support unavailability feature
* updated light component to support unavailability feature
* updated cover component to support unavailability feature
* set _hass property
* added unavailability tracker, updated sensor component
* change hass argument position according to position in binary_sensor
* added hass argument to binary_sensor, updated is_on(), it can be UNAVAILABLE now
* updated switch component to support unavailability feature
* updated light component to support unavailability feature
* updated cover component to support unavailability feature
* set _hass property
* fixed error with wrong arguments number during callback call
* reset unavailability state on new message received from device
* use locks to fix race condition during managing _state property
* overriden state() method for some components to check for STATE_UNAVAILABLE and return it instead e.g. STATE_OFF
* fixed linter
* removed blank line
* use available() method instead of changing _state
* filter motion sensors 'heartbeat', was removed from PyXiaomiGateway
* remove self._hass, use self.hass set by HA on attach
* self.push_data now running in the event loop, use async_schedule_update_ha_state()
* merge fix
* removed accidentally added home-assistant-polymer
* bump PyXiaomiGateway version to 0.8.0
* bump PyXiaomiGateway to 0.8.0
* updated methods names and annotations
* Adding BME680 Sensor Component
* Flake8 lint fixes
* PyLint fixes
* Fix for log line
* Updating requirements for testing
* Fix PyLint Log format errors and add to coveragerc ommisions as requires sensor connected
* Regenerated requirements_all.txt
* Added Pylint exception for import error of system specific library
* Refactored async_add_platform to move IO out to avoid heavy yield usage
* 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
The sensors are meant to be put on windows to shut down the heating when
windows are open. Having 'window' device class instead of 'opening' is
much more logical here.
* 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
Add waterfurnace platform
This adds support for waterfurnace geothermal systems. This is
implemented as a component as there will eventually be some active
control elements. This is not done as a climate platform because
geothermal systems work best when set at a constant temperature as
they are tuned to keep within 0.5 degrees F of a setpoint, and large
temperature shifts are slow and expensive.
This is done in the Data + Sensors model, with the Data component
having a regular update thread. That thread needs to call the read()
function at least every 30 seconds otherwise the underlying websocket
is closed by the server.
* Added IHC platform
* Updated requirements for IHC platform
* Exclude IHC from test
* Correcting flake8 issues
* Fixing more flake8 issues
* Fixed flake8 issues
* Fixing pylint issues
* Fixed flake8 issues
* Changes from PR review.
* STATE_UNKNOWN changed to None
* Spelling mistake in comment
* Added IHC platform
* Updated requirements for IHC platform
* Exclude IHC from test
* Correcting flake8 issues
* Fixing more flake8 issues
* Fixed flake8 issues
* Fixing pylint issues
* Fixed flake8 issues
* Changes from PR review.
* STATE_UNKNOWN changed to None
* Spelling mistake in comment
* Updated requirements_all.txt with gen_requirements_app.py
* Pylint fix: No space allowed around keyword argument assignment
* PR review changes
* Moved auto setup from platforms to ihc component
* Do no auto setup if there are no IHC products found
* Changes from PR review
* Updated bluepy to version 1.1.4 as some issues with the native code were fixed there.
* Miflora - Added support for bluepy backend.
* miflora - now using bluepy backend on linux platforms
* fixed pylint findings
* miflora now using bluepy as default bluetooth backend and gatttool as fallback
* fixed hound complaints
* fixed pylint warning
* updated requirements
* Update miflora.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
* add pyhomematic support for ip and tiltable covers
* use cached data in current_cover_tilt_position
* check for existance not for None
* reformatting
* check node for LEVEL_2
* Service for setting a fixed scene introduced.
Fixes https://github.com/syssi/philipslight/issues/6.
Fixes https://github.com/home-assistant/home-assistant/issues/10458.
* Service description added.
* Typo fixed.
* Error message updated and naming improved.
* Name ("scene") of the method parameter aligned.
* Hound error fixed: Spaces removed.
* async_setup_platform method simplified.
* Lazy loading of service descriptions.
* Unused import removed.
* 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
* Signal callback isnt JSON serializable so it has to be removed before saving to conf
* Remove filtered events list which is not a part of component configuration
* Added support for TekSavvy bandwidth sensor
* Variable name fix
* Units are Gigabytes and not Gigabits
* Change REST calls to use asyncio
* houndci violation fix
* pylint fix
* Fix for code review
* Import order asyncxxx:wq
* Tweak docstrings and log message
* 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
* Wemo Dimmer Support
Add support for the Wemo Dimmer Switch
* Add newline at end of file
Re: findings from hound
* Syntax for the hound
Sorry for the excess edits, new to python
* Change order of Models
Fixed order back to ABC order
* Changes as requested
I made the changes I was comfortable with at this point, the dimmer addition now very closely mirrors what is under the switch component, at least as far as the parts necessary for the dimmer.
Any changes past these with regards to the subscription registry / callback info is probably going to be over my head, but I will try to look deeper at them if required.
* Remove unnecessary lines
Removed self.schedule_update_ha_state() from turn off / turn on
* Remove update(self)
Removed update method
* Move subscription to async_added_to_hass
* Move subscription.
* Clean up.
* Wait until the job in the executor is done
* Run gen_requirements_all script
* Only update instance attributes via callback
* mychevy: added basic mychevy component
This implements a component using the mychevy library (which utilizes
selenium to webscrape the mychevy website for onstar for your
car). The architecture works by having a background thread doing
periodic polling of the website, and updating the sensors when new
data is found.
This requires rather more setup than most platforms, as you need
working selenium. Instructions will be provided on the component
list. All the sensors are spawned and coordinated from a single "hub"
as they are really just attributes of the same web scraping session.
* mychevy: only poll every 30 minutes
* mychevy: update sensors
* mychevy: better error handling
* mychevy: tweaking for refactor
* mychevy: bump version to handle odometer > 1000
* mychevy: great sensor reorg
* mychevy: add binary sensors
* mychevy: bump mychevy requirement
* mychevy: use dispatcher
Instead of directly modifying the sensors, this lets us use a
dispatcher to have sensors pull information from the car object when
there is a relevant update for them.
* mychevy: remove from coverage
* mychevy: dedicated constants for dispatch signals
This makes the dispatch signals dedicated topics, and fixes updating
the state on the sensors so that they are correctly updated.
* mychevy: updated with comments from martinhjelmare
* mychevy: set battery icon based with helper function
* Address additional review feedback
* Address additional review comments
* Strip off the RTS/IO ID from the entity ID
* Ignore exception thrown when the device does not provide an active state
* Send actions with a label for easier identification in the Tahoma log
* Linting
* Strip off the RTS/IO ID from the entity ID, take 2
As per suggestions, let HA do the standard initialization and assign
an appropriate entity_id, instead of overriding it with the lengthy
unique_id coming from the TaHoma devices.
* Hyperion: Add brightness, HDMI and effect support
- added brightness support to dim the hyperion light
- changed the "OFF" command to set the color to [0,0,0] after clearing all priorities.
This is neccesary to keep the light turned off when an HDMI grabber is used for ambilight with hyperion.
- added HDMI ambilight mode recognition and control.
by setting the "hdmi_priority" in your "configuration.yaml" file (defaults to 880), home assistant will now be able to recognize when the hyperion light is in HDMI ambilight mode and will change its icon to an HDMI symbol and set the status to ON.
Switching the hyperion light to HDMI ambilight mode can be done through the effect option (clears all priorities such that the HDMI grabber remains).
- added effect support for the default effects of hyperion, a custom list can be defined in the "configuration.yaml" file by using the "effect_list" option.
* Hyperion: Add brightness, HDMI and effect support
- added brightness support to dim the hyperion light
- changed the "OFF" command to set the color to [0,0,0] after clearing all priorities.
This is neccesary to keep the light turned off when an HDMI grabber is used for ambilight with hyperion.
- added HDMI ambilight mode recognition and control.
by setting the "hdmi_priority" in your "configuration.yaml" file (defaults to 880), home assistant will now be able to recognize when the hyperion light is in HDMI ambilight mode and will change its icon to an HDMI symbol and set the status to ON.
Switching the hyperion light to HDMI ambilight mode can be done through the effect option (clears all priorities such that the HDMI grabber remains).
- added effect support for the default effects of hyperion, a custom list can be defined in the "configuration.yaml" file by using the "effect_list" option.
- fixed some style issues with too long lines
* Hyperion: Add brightness, HDMI and effect support
- fixed some more indentation style issues
* Hyperion: Add brightness, HDMI and effect support
- yet more fixed visuel indent issues
* Hyperion: Add brightness, HDMI and effect support
- more visuel indents
* Hyperion: Add brightness, HDMI and effect support
- fixed invalid variable "A"
* Hyperion: Add brightness, HDMI and effect support
- remove unnececary brackets
- specify specific exceptions
* correct changing state holding attributes during a service method
Proccesed the comments of @MartinHjelmare: https://github.com/home-assistant/home-assistant/pull/11543#pullrequestreview-88328659
* indent correction
corrected tab instead of 4 spaces
* Hyperion: Add brightness, HDMI and effect support
- changed 'none' to None
- renamed "self._skip_check" to "self._skip_update"
* Add brightness, HDMI and effect support
changed checking if a list is empty from "list == []" to "not list"
* Adding support for Lutron Radio RA2 shades as cover components.
* Adding initial version of the Lutron shades component.
* Fixed line-length violation detected by Hound.
* 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
* Added support for enable/disable motion detection
* Changed name of variable for exception, lint error
* Moved motion_detection_enabled property to the other properties
* 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
* Make the order shown in the history component match the ordering given in the configuration of included entities (if any)
* return the sorted result
* optimize sorting. since entities only appear once, we can break from a search on first find, and no copy of the list is needed
* 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
* Make the rpi_rf component thread-safe
The previous implementation suffered from race conditions when two rpi_rf switches are triggered at the same time. This implementation uses an RLock to give one thread at a time exclusive access to the rfdevice object.
* cleanup
* fix lint
* 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
If the `google_assistant` key exists in the config but has no
`entity_config` key under it you'll get an error.
```
File "/Users/pkates/src/home-assistant/homeassistant/components/google_assistant/http.py", line 51, in is_exposed
entity_config.get(entity.entity_id, {}).get(CONF_EXPOSE)
AttributeError: 'NoneType' object has no attribute 'get'
```
* Add 2 media_player services and 1 custom service to Squeezebox platform
* Fix pylint error
* Remove apostrophe in example
* Split method into command and parameters
* Fix Lint error
* Switch the ZoneMinder event sensor over to use the consoleEvents API, and add monitored_conditions for 'hour', 'day', 'week', 'month' and 'all'. 'all' is enabled by default to provide backward compatibility with the old behaviour.
* - Switch to new string formatting
- Remove redundant validator
* De-lint