* Huge ISY994 platform cleanup, fixes support for 5.0.10 firmware
# * No more globals - store on hass.data
# * Parent ISY994 component handles categorizing nodes in to Hass components, rather than each individual domain filtering all nodes themselves
# * Remove hidden string, replace with ignore string. Hidden should be done via the customize block; ignore fully prevents the node from getting a Hass entity
# * Removed a few unused methods in the ISYDevice class
# * Cleaned up the hostname parsing
# * Removed broken logic in the fan Program component. It was setting properties that have no setters
# * Added the missing SUPPORTED_FEATURES to the fan component to indicate that it can set speed
# * Added better error handling and a log warning when an ISY994 program entity fails to initialize
# * Cleaned up a few instances of unecessarily complicated logic paths, and other cases of unnecessary logic that is already handled by base classes
* Use `super()` instead of explicit base class calls
* Move `hass` argument to first position
* Use str.format instead of string addition
* Move program structure building and validation to component
Removes the need for a bunch of duplicate exception handling in each individual platform
* Fix climate nodes, fix climate names, add config to disable climate
Sensor platform was crashing when the ISY reported climate nodes. Logic has been fixed. Also added a config option to prevent climate sensors from getting imported from the ISY. Also replace the underscore from climate node names with spaces so they default to friendly names.
* Space missing in error message
* Fix string comparison to use `==`
* Explicitly check for attributes rather than catch AttributeError
Also removes two stray debug lines
* Remove null checks on hass.data, as they are always null at this point
* Enable more alarm decoder attributes, including chime status and ready status
* Expose chime service in the alarm decoder component
* Fix line length linting issue
* Fix spacing lint issue
* Update PR based on reviewer requests
* Update based on linting catches
* Fix descriptions include from async to sync
* Store raw state of RF sensors from alarmdecoder
* Fix resync. Fix issue with RFID not being truly optional
* Breakdown RF attributes per bit
* Preserve import style
* alexa: Add handling for covers
Covers don't support either cover.turn_on or homeassistant.turn_on so
use cover.[open|close]_cover.
* alexa: Add tests for covers
* Cleaned up '_clear_media()'
* Moved media Type to new method
* renamed "clear_media()' to ' clear_media_details()'
reset 'app_name' (Library Name) in clear_media_details
moved thumbs to '_set_media_image()'
* Moved playback info into setmedia type as it was just used for the next anyway
* Moved library name & image download to only happen if session and player active as else no point anyway
* Fixed Linting issue
* Some tweaks to clean up unintended complexity
* Removed redundant declarations
* Fixed whitespace
* Revert "Fixed whitespace"
This reverts commit 0985445c47.
* Revert "Removed redundant declarations"
This reverts commit 6f9d5a85b0.
* Improve support for multiple Hue bridges with lights that have the same id.
The old code pre-refactoring kept a per-bridge list of lights in a closure; my refactoring moved that to hass.data, which is convenient but caused them to conflict with each other.
Fixes#11183
* Update test_hue.py
* Call update on Sesame devices to cache initial state
* Switch to using async_add_devices
* Fix line length
* Fix Lint errors
* Fix more Lint errors
* Cache pysesame properties
* Updates from CR feedback
* added functionality to save/restore snapshots to monoprice platform
* renamed monoprice_snapshot, monoprice_restore to snapshot, restore
This is to simplify refactoring of snapshot/restore functionality for monoprice, snapcast and sonos in the future
* Adding MotionIP to BinarySensors for HMIP-SMI
My HmIP-SMI (Homematic IP Motion Sensor) only shows "ILLUMINATION" and no MOTION, because the binary values are not recognized. The "old" homematic-motion detectors are working well showing motion, too.
I found out that "MotionIP" was missing at the binary_sensors - after adding "Motion" and "Motion Detection Activated" are shown.
* Removed trailing blanks
removed trailing blanks from my previous change
* Use constant for offline state
* Use constant for no game name
* Rename trade and play constant their proper names
Trade and Play are not the correct names for the states. For instance
Play might be seens as the user is actually is playing, which is not
correct as there is no such state is returned from the Steam API.
Just having "trade" does not say much about what is happening and
might be misintepreted that the user is currently trading, which is not
correct either.
We instead use the names from the underlying library for naming the
states [1]
[1] 2e518ad84f/steam/user.py (L109)
* Get the proper game name if no extra info is given from the api
The third `current_game` parameter that was used before hold
extra information about the game that is being played. This might
contain the game name, it might also be empty. The correct way to
get the game name is to fetch it from the API depending on the
game id that might be returned in the `current_game` attribute if
the user is playing a game.
To not break existing implementations we keep the functionality
to first go with the extra information and only then fetch the proper
game name.
* Refactor getting game name to its own function
This cleans up the code and removed "ugly" else statements
from the sensor and makes the game fetching easier to read.
* Let state constant values be lower snake case
* Return None instead of 'None' when no current game exists
* Initialize steam app list only once to benefit form caching
* Return None as state attributes if no current game is present
* Fix detection of if a negative node is in use
Fix a problem where every negative node gets detected as in-use. Code was not checking the correct property.
* Allow protected access
* Extend Threshold binary sensor to support ranges
- Adds support for ranges
- Threshold type (lower, upper, range) is defined by supplied
thresholds (lower, upper)
- Adds verbose status/position relative to threshold as attribute
(position)
* Minor changes (ordering, names, etc.)
* Update name
* Update name
* Fix statistics sensor mean and median when only one sample is available.
With only one data point stddev and variance throw an exception.
This would clear the (valid) mean and median calculations.
Separate the try..catch blocks for one-or-more and two-or-more stats so
that this doesn't happen.
Test this with a new sampling_size_1 test.
* test_statistics trivial whitespace fix
Sonos Playbar and Playbase devices support Night Sound and Speech Enhancement
effects when playing from sources such as a TV. Adds a new service "sonos_set_option"
whichs accepts boolean options to control these audio features.
* Fix X10 commands for mochad light turn on
This commit attempts to address issues that a lot of people are having
with the x10 light component. Originally this was written to use the
xdim (extended dim) X10 command. However, not every X10 dimmer device
supports the xdim command. Additionally, it turns out the number of
dim/brighness levels the X10 device supports is device specific and
there is no way to detect this (given the mostly 1 way nature of X10)
To address these issues, this commit removes the usage of xdim and
instead relies on using the 'on' command and the 'dim' command. This
should work on all x10 light devices. In an attempt to address the
different dim/brightness levels supported by different devices this
commit also adds a new optional config value, 'brightness_levels', to
specify if it's either 32, 64, or 256. By default 32 levels are used
as this is the normal case and what is documented by mochad.
Fixes#8943
* make code more readable
* fix style
* fix lint
* fix tests
* Fire events for ISY994 control events
This allows hass to react directly to Insteon button presses (on switches and remotes), including presses, double-presses, and long holds
* Move change event subscription to after entity is added to hass
The event handler method requires `self.hass` to exist, which doesn't have a value until the async_added_to_hass method is called. Should eliminate a race condition.
* Overhaul binary sensors in ISY994 to be functional "out of the box"
We now smash all of the subnodes from the ISY994 in to one Hass binary_sensor, and automatically support both paradigms of state reporting that Insteon sensors can do. Sometimes a single node's state represents the sensor's state, other times two nodes are used and only "ON" events are sent from each. The logic between the two forunately do not conflict so we can support both without knowing which mode the device is in.
This also allows us to handle the heartbeat functionality that certain sensors have - we simply store the timestamp of the heartbeat as an attribute on the sensor device. It defaults to Unknown on bootup if and only if the device supports heartbeats, due to the presence of subnode 4.
* Parse the binary sensor device class from the ISY's device "type"
Now we automatically know which sensors are moisture, motion, and openings! (We also reverse the moisture sensor state, because Insteon reports ON for dry on the primary node.)
* Code review tweaks
The one material change here is that the event subscribers were moved to the `async_added_to_hass` method, as the handlers depend on things that only exist after the entity has been added.
* Handle cases where a sensor's state is unknown
When the ISY first boots up, if a battery-powered sensor has not reported in yet (due to heartbeat or a change in state), the state is unknown until it does.
* Clean up from code review
Fix coroutine await, remove unnecessary exception check, and return None when state is unknown
* Unknown value from PyISY is now -inf rather than -1
* Move heartbeat handling to a separate sensor
Now all heartbeat-compatible sensors will have a separate `binary_sensor` device that represents the battery state (on = dead)
* Add support for Unknown state, which is being added in next PyISY
PyISY will report unknown states as the number "-inf". This is implemented in the base ISY994 component, but subcomponents that override the `state` method needed some extra logic to handle it as well.
* Change a couple try blocks to explicit None checks
* Bump PyISY to 1.1.0, now that it has been published!
* Remove -inf checking from base component
The implementation of the -inf checking was improved in another branch which has been merged in to this branch already.
* Restrict negative-node and heartbeat support to known compatible types
Not all Insteon sensors use the same subnode IDs for the same things, so we need to use different logic depending on device type. Negative node and heartbeat support is now only used for leak sensors and open/close sensors.
* Use new style string formatting
* Add binary sensor detection for pre-5.x firmware
Meant to do this originally; writing documentation revealed that this requirement was missed!
* Allow using more than one keyboard remote
This sets up one thread per keyboard remote, listening for events.
* Remove enclosing block in keyboard_remote
* Remove unnecessary semantic check for keyboard_remote
* Add media progress information
* Remove unnecessary comments
* Remove datetime import
* Remove pysonyavr dependency
* Fix doc syntax (D205)
* Lint fix: no-else-return
* Don't attempt to set media progress info if program is None
* Fix Python 3.4 compatibility
* Explicitely depend on pyteleloisirs
* Only update remaining play time when it changed
* Fix floot state table
* Introduce a new Hue component that knows how to talk to a Hue bridge, but doesn't actually set up lights.
* Refactor the hue lights platform to use the HueBridge class from the hue component.
* Reimplement support for multiple bridges
* Auto discover bridges.
* Provide some migration support by showing a persistent notification.
* Address most feedback from code review.
* Call load_platform from inside HueBridge.setup passing the bridge id.
Not only this looks nicer, but it also nicely solves additional bridges being added after initial setup (e.g. pairing a second bridge should work now, I believe it required a restart before).
* Add a unit test for hue_activate_scene
* Address feedback from code review.
* After feedback from @andrey-git I was able to find a way to not import phue in tests, yay!
* Inject a mock phue in a couple of places
* Add support for Logitech UE Smart Radios.
* Removed full stops to please Hound's line limit.
* Updated with requested changes.
* Fix Pylint Flake8 problem.
* Updated with requested changes.
All mochad devices are sharing a single socket interface. When multiple
threads are issuing requests to the mochad daemon at the same time the
write read cycle might get crossed between the threads. This is normally
not an issue for 1-way X10 devices because as long as the request issued
successfully and data is read over the socket then we know as much as
mochad will tell us (since there is no ACK from the request for most
X10 devices). However, where it does matter is on the device __init__()
because we're relying on the mochad daemon's internal state to take an
educated guess at the device's state to intialize things with. When
there are multiple devices being initialized at the same time the wires
can get crossed between and the wrong device state may be read.
To address this potential issue this commit adds locking using a
semaphore around all pairs of send_cmd() and read_data() (which is what
pymochad.device.Device.get_status() does internally) calls to the mochad
controller to ensure we're only ever dealing with a single request at a
time.
Fixesmtreinish/pymochad#4
* Updated snips to listen on new mqtt topic and use rawValue if value not present in slot
* Too late at night
* Trying to make minor changes via web
* Update test_snips.py
* Update __init__.py
* Updated wrong branch cause I'm a monkey
* Add Canary component
* Made some change to how canary data is updated and stored
* Updated to use py-canary:0.1.2
* Addressed flake8 warnings
* Import canary API locally
* Import canary API locally again
* Addressed pylint errors
* Updated requirements_all.txt
* Fixed incorrect unit of measurement for air quality sensor
* Added tests for Canary component and sensors
* Updated canary component to handle exception better when initializing
* Fixed tests
* Fixed tests again
* Addressed review comments
* Fixed houndci error
* Addressed comment about camera force update
* Addressed comment regarding timeout when fetching camera image
* Updated to use py-canary==0.2.2
* Increased update frequency to 30 seconds
* Added support for Canary alarm control panel
* Address review comments
* Fixed houndci error
* Fixed lint errors
* Updated test to only test setup component / platform
* Fixed flake error
* Fixed failing test
* Uptake py-canary:0.2.3
* canary.alarm_control_panel DISARM is now mapped to canary PRIVACY mode
* Fixed failing tests
* Removed unnecessary methods
* Removed polling in canary camera component and update camera info when getting camera image
* Added more tests to cover Canary sensors
* Address review comments
* Addressed review comment in tests
* Fixed pylint errors
* Excluded canary alarm_control_panel and camera from coverage calculation
* initial commit of shuffle option for sonos
* added test
* Small adjustments to adhere to review requests
* Removed unnessesary setting of variable. Use shuffle state from soco instead
In a case where either (a) an incorrect source name is used, or (b) the
TV isn't currently queryable (e.g. it's off), we get tracebacks because
we assume the source that we are being asked to select exists in
self._source_list.
This makes the lookup code a little more rugged, and adds in a warning
message (in place of the current exception).
* Device tracker for meraki AP
* styles fix
* fix again
* again
* and again :)
* fix hide if away
* docs and optimization
* tests and fixes
* styles
* styles
* styles
* styles
* styles fix. Hope last
* clear track new
* changes
* fix accuracy error and requested changes
* remove meraki from .coveragerc
* tests and minor changes
* remove location