* 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
* trying to rework device discovery. now the main component will do the getlinked and pass it to the sub-components. no longer any config needed other than what is needed to connect to the hub. device names are no longer stored. core team told us to stop using configurator to ask for names. there should be a way to set names in hass...possibly this https://home-assistant.io/docs/configuration/customizing-devices/
* fix device types
* make device names just be the isnteon device id
* revert some config changes
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* update insteon client
* linting fixes
* Error Clean up
* Update to make requested changes
* more changes
* Finish requested changes to components
* Fixing Rebase Conflicts
* fix device types
* make device names just be the isnteon device id
* revert some config changes
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* Update insteon_local.py
* update insteon client
* linting fixes
* Error Clean up
* Update to make requested changes
* more changes
* Finish requested changes to components
* Update Insteon_Local for performance improvements
* Fix errors from get_linked
* Fix typo
* Requested changes
* Fix spacing
* Clean up
* Requested Changes
* 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
* Issue #11432: Do not stop initializing KNX when tunelling device cant be reached
* Issue #11432: Mark devices as unavailable if gateway cant be connected
* Add new iGlo component
* Missing comma
Add extra blank lines
* Dont change state in turn_on
Remove unused variables
Update before add
* Fixing some lint issues
* Base implementation of component, no sensors yet
* Added senor files
* First fully working chain of sensors and binary sensors going from hardware in to hass
* Clean up
* Clean up
* Added light platform
* Turning lights on and off and set brightness now works
* Pydeconz is now a proper pypi package
Stop sessions when Home Assistant is shutting down
Use a simpler websocket client
* Updated pydocstrings
Followed recommendations from pylint and flake8
* Clean up
* Updated requirements_all.txt
* Updated Codeowners to include deconz.py
Also re-added the Axis component since it had gotten removed
* Bump requirement
* Bumped to v2
Reran script/gen_requirements
* Removed global DECONZ since it wasn't relevant any more
* Username and password is only relevant in the context of getting a API key
* Add support for additional sensors
* Added support for groups
* Moved import of component library to inside of methods
* Moved the need for device id to library
* Bump pydeconz to v5
* Add support for colored lights
* Pylint and flake8 import improvements
* DATA_DECONZ TO DECONZ_DATA
* Add support for transition time
* Add support for flash
* Bump to v7
* ZHASwitch devices will now only generate events by default, instead of being a sensor entity
* Clean up
* Add battery sensor when device signals through an event
* Third-party library communicates with service
* Add support for effect colorloop
* Bump to pydeconz v8
* Same domain everywhere
* Clean up
* Updated requirements_all
* Generated API key will now be stored in a config file
* Change battery sensor to register to callback since library now supports multiple callbacks
Move DeconzEvent to hub
Bump to v9
* Improve entity attributes
* Change end of battery name to battery level
No need for static icon variable when using battery level helper
* Bump requirement to v10
* Improve pydocstring for DeconzEvent
Rename TYPE_AS_EVENT to CONF_TYPE_AS_EVENT
* Allow separate brightness to override RGB brightness
* Expose device.reachable in entity available property
* Bump requirement to 11 (it goes up to 11!)
* Pylint comment
* Binary sensors don't have unit of measurement
* Removed service to generate API key in favor of just generating it as a last resort of no API key is specified in configuration.yaml or deconz.conf
* Replace clear text to attribute definitions
* Use more constants
* Bump requirements to v12
* Color temp requires xy color support
* Only ZHASwitch should be an event
* Bump requirements to v13
* Added effect_list property
* Add attribute to battery sensor to easy find event id
* Bump requirements to v14
* Fix hound comment
* Bumped requirements_all information to v14
* Add service to configure devices on deCONZ
* Add initial support for scenes
* Bump requirements to v15
* Fix review comments
* Python doc string improvement
* Improve setup and error handling during setup
* Changed how to evaluate light features
* Remove 'ghost' events by not triggering updates if the signal originates from a config event
Bump requirement to v17
* Fix pylint issue by moving scene ownership in to groups in requirement pydeconz
Bump requirement to v18
* Added configurator option to register to deCONZ when unlocking gateway through settings
Bump requirement to v20
* Improve async configurator
* No user interaction for deconz.conf
* No file management in event loop
* Improve readability of load platform
* Fewer entity attributes
* Use values() instead of items() for dicts where applicable
* Do one add devices per platform
* Clean up of unused attributes
* Make sure that discovery info is not None
* Only register configure service and shutdown service when deconz has been setup properly
* Move description
* Fix lines longer than 80
* Moved deconz services to a separate file and moved hub to deconz/__init__.py
* Remove option to configure switch as entity
* Moved DeconzEvent to sensor since it is only Switch buttonpress that will be sent as event
* Added support for automatic discovery of deconz
Thanks to Kroimon for adding support to netdisco
* Use markup for configuration description
* Fix coveragerc
* Remove deCONZ support from Hue component
* Improved docstrings and readability
* Remove unnecessary extra name for storing in hass.data, using domain instead
* Improve readability by renaming all async methods
Bump to v21 - improved async naming on methods
* Fix first line not being in imperative mood
* Added logo to configurator
Let deconz.conf be visible since it will be the main config for the component after initial setup
* Removed bridge_type from new unit tests as part of removing deconz support from hue component
* Capitalize first letters of Battery Level
* Properly update state of sensor as well as reachable and battery
Bump dependency to v22
* Fix flake8 Multi-line docstring closing quotes should be on a separate line
* Fix martinhjelmares comments
Bump dependency to v23
Use only HASS aiohttp session
Change when to use 'deconz' or domain or deconz data
Clean up unused logger defines
Remove unnecessary return values
Fix faulty references to component documentation
Move callback registration to after entity has been initialized by HASS
Less inception style on pydocs ;)
Simplify loading platforms by using a for loop
Added voluptous schema for service
Yaml file is for deconz only, no need to have the domain present
Remove domain constraint when creating event title
Reverts energy and power unit conversions added in #10979 as they break
early devices.
A proper fix should be implemented in the pyhs100 library which should
return common units across all devices/firmwares.
* Use different colour channel intensities in tests
Uses a different value for each colour channel in MQTT light tests to
properly differentiate between colour channels.
* Correct ordering of RGB channels in MQTT light
* Correct units used in TP-Link energy monioring
- Energy is measured in kWh for swtches
- Power is reported in mW for bulbs
- Energy is reported in Wh for bulbs
* TP-Ling energy: store units in attribute names
Stores the unit in the attrbute names for TP-Link devices that support
energy monitoring.
* 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
* 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
* 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
* 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
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
* add ads hub, light and switch
* add binary sensor prototype
* switch: use adsvar for connection
* fix some issues with binary sensor
* fix binary sensor
* fix all platforms
* use latest pyads
* fixed error with multiple binary sensors
* add sensor
* add ads sensor
* clean up after shutdown
* ads component with platforms switch, binary_sensor, light, sensor
add locking
poll sensors at startup
update state of ads switch and light
update ads requirements
remove update() from constructors on ads platforms
omit ads coverage
ads catch read error when polling
* add ads service
* add default settings for use_notify and poll_interval
* fix too long line
* Fix style issues
* no pydocstyle errors
* Send and receive native brightness data to ADS device to prevent issues with math.floor reducing brightness -1 at every switch
* Enable non dimmable lights
* remove setting of self._state in switch
* remove polling
* Revert "remove polling"
This reverts commit 7da420f823.
* add service schema, add links to documentation
* fix naming, cleanup
* re-remove polling
* use async_added_to_hass for setup of callbacks
* fix comment.
* add callbacks for changed values
* use async_add_job for creating device notifications
* set should_poll to False for all platforms
* change should_poll to property
* add service description to services.yaml
* add for brigthness not being None
* put ads component in package
* Remove whitespace
* omit ads package
* Refactored to new global json saving and loading
* Fixed emulated_hue tests
* Removed unnecassary error handling
* Added missing newline
* Remove unused imports
* Fixed linting error
* Moved _load_json wrapper out of the config class
When lights in the hue component are used with the emulated hue component ATTR_EMULATED_HUE is still being used, which was deprecated by #9382. This updates ATTR_EMULATED_HUE to ATTR_EMULATED_HUE_HIDDEN to improve consistency and stop the deprecation warnings.
* Added ability to control when the on command is sent.
* Changed to allow only brightness command
* Code cleanup
* Added test cases for on command mode.
* Added addition test
* Changed brightness options to lower case.
* Fixed case of default value
* Remove default
* Xiaomi Air Purifier 2 integration
* Flake8 errors fixed.
Changes based on review.
* Service domain ("fan") updated and services properly prefixed by xiaomi_miio.
* The underlying library is called python-miio now. Imports and requirements updated.
* Version bumped. The underlying library is called python-miio now.
* Add emeter attributes.
* Remove unused attributes.
* Rework supported features so it only queries the bulb once.
* Used cached supported_features, catch errors if energy usage not reported.
* New Skybell platform with components
* Added skybell components to omit.
* Preemptively fixing lint issues (hopefully).
* Removed unused variable.
* Requested changes.
* Additional CRs
* Hopefully the last of the CR's!
* bump the pyhs100 version and fix api changes
* switch.tplink: avoid I/O during __init__
* initialize _name to None in __init__
* update requirements_all.txt for the new version
With this optimization we can send a single UDP packet to the light rather
than one packet per zone (up to 80 packets for LIFX Z). This removes a
potential multi-second latency on the frontend color picker.
The aiolifx 0.6.0 release fixes an issue where an effect color could
remain set after stopping the effect. This only affected multi-zone
lights (i.e. LIFX Z) and only if the effect was stopped by setting
the light brightness or the color (but not both).
The aiolifx 0.6.0 release also defaults end_index to start_index+7,
so we can remove that argument.
Finally, aiolifx_effects 0.1.2 adds support for aiolifx 0.6.0.
* renamed add_devices to async_add_devices according to hass naming scheme
* replaced some occurencies of async_add_entites to async_add_devices
* fixed unit test
* fixed unit test
* Updated to latest AbodePy version. Added services and events. Added new device types. Added exclude, light, and polling config options.
* Disable the event service if polling is enabled.
* Addressed all CR's
* Removed duplicated super call.
* Name config option now used. Removed deprecated DEFAULT_NAME.
* Modified partial to move event to first param.
* rename xiaomi to xiaomi_aqara
* rename xiaomi vacuum and xiaomi phillips light to xiaomi miio
* update discovery and tests
* style
* update discovery and tests
* Still use Philips as name
* Update tradfri.py
## 201709013: set_hex_color() seems not to work in pytradfri api - set_rgb_color() does
## -> changed function set_hex_color() to set_rgb_color()
## tested w. IKEA tradfri GW and zigbee rgb PWM module (dresden elektronik FLS-PP lp)
* Update tradfri.py
Setup:
Home Assistant 0.53.0
pytradfri 2.2
IKEA tradfri gateway fw 1.1.0015
zigbee rgb PWM module (dresden elektronik FLS-PP lp)
Issue:
pytradfri's set_hex_color() does not work for arbitrary colors with the current IKEA tradfri gateway. Only setting rgb hex values (param 5706) of some predefined colors has the desired effect. Others will fall back to one predefined value. I assume, the GW doesn't allow for values deviating from the predefined values.
However, pytradfri's set_rgb_color() does also work for arbitrary colors. Latest pytradfri (2.2/PR51?) will convert rgb to xy and send xy thru the GW (param 5709 and 5710).
-> changed the function used from set_hex_color() to set_rgb_color() in HA's component\light\tradfri
Result:
Full RGB support with arbitrary colors with my setup.
Unfortunately I cannot test tradfri GW with other bulbs (no have hue/lightify bulbs).
___
Predefined colors from <https://github.com/ggravlingen/pytradfri/pull/51>:
this.f3891b = new HashMap();
this.f3891b.put("f5faf6", new C1386c(0.3804d, 0.3804d, "f5faf6", 0.54d));
this.f3891b.put("f1e0b5", new C1386c(0.4599d, 0.4106d, "CCT_LIGHT_NEUTRAL", 0.61d));
this.f3891b.put("efd275", new C1386c(0.5056d, 0.4152d, "efd275", 0.66d));
this.f3891b.put("dcf0f8", new C1386c(0.3221d, 0.3317d, "dcf0f8", 0.45d));
this.f3891b.put("eaf6fb", new C1386c(0.3451d, 0.3451d, "eaf6fb", 0.48d));
this.f3891b.put("f5faf6", new C1386c(0.3804d, 0.3804d, "f5faf6", 0.54d));
this.f3891b.put("f2eccf", new C1386c(0.4369d, 0.4041d, "f2eccf", 0.59d));
this.f3891b.put("CCT_LIGHT_NEUTRAL", new C1386c(0.4599d, 0.4106d, "CCT_LIGHT_NEUTRAL", 0.61d));
this.f3891b.put("efd275", new C1386c(0.5056d, 0.4152d, "efd275", 0.66d));
this.f3891b.put("ebb63e", new C1386c(0.5516d, 0.4075d, "ebb63e", 0.68d));
this.f3891b.put("e78834", new C1386c(0.58d, 0.38d, "e78834", 0.69d));
this.f3891b.put("e57345", new C1386c(0.58d, 0.35d, "e57345", 0.67d));
this.f3891b.put("da5d41", new C1386c(0.62d, 0.34d, "da5d41", 0.7d));
this.f3891b.put("dc4b31", new C1386c(0.66d, 0.32d, "dc4b31", 0.73d));
this.f3891b.put("e491af", new C1386c(0.5d, 0.28d, "e491af", 0.57d));
this.f3891b.put("e8bedd", new C1386c(0.45d, 0.28d, "e8bedd", 0.53d));
this.f3891b.put("d9337c", new C1386c(0.5d, 0.24d, "d9337c", 0.55d));
this.f3891b.put("c984bb", new C1386c(0.34d, 0.19d, "c984bb", 0.38d));
this.f3891b.put("8f2686", new C1386c(0.31d, 0.12d, "8f2686", 0.33d));
this.f3891b.put("4a418a", new C1386c(0.17d, 0.05d, "4a418a", 0.18d));
this.f3891b.put("6c83ba", new C1386c(0.2d, 0.1d, "6c83ba", 0.22d));
this.f3891b.put("a9d62b", new C1386c(0.4099999964237213d, 0.5099999904632568d, "a9d62b", 0.654d));
this.f3891b.put("d6e44b", new C1386c(0.44999998807907104d, 0.4699999988079071d, "d6e44b", 0.65d));
* First draft of XKNX module for Home-Assistant
* XKNX does now take path of xknx.yaml as parameter
* small fix, telegram_received_callback has different signature
* changed method of registering callbacks of devices
* removed non async command lines from xknx
* telegram_received_cb not needed within HASS module
* updated requirements
* Configuration if XKNX should connect via Routing or Tunneling
* bumping version to 0.6.1
* small fix within xknx plugin
* bumped version
* XKNX-Switches are now BinarySensors and Logic from Sensor was moved to BinarySensor
* renamed Outlet to Switch
* pylint
* configuration of KNX lights via HASS config, yay!
* changed name of attribute
* Added configuration for xknx to switch component
* added support for sensors within hass configuration
* added support for climate within hass configuration
* Thermostat -> Climate
* added configuration support for binary_sensors
* renamed Shutter to Cover
* added configuration support for cover
* restructured file structure according to HASS requirements
* pylint
* pylint
* pylint
* pylint
* pylint
* pylint
* updated version
* pylint
* pylint
* pylint
* added setpoint support for climate devices
* devices are now in a different module
* more asyncio :-)
* pydocstyle
* pydocstyle
* added actions to binary_sensor
* allow more than one automation
* readded requirement
* Modifications suggested by hound
* Modifications suggested by hound
* Modifications suggested by hound
* Modifications suggested by hound
* xknx now imported as local import
* hound *sigh*
* lint
* 'fixed' coverage.
* next try for getting gen_requirements_all.py working
* removed blank line
* XKNX 0.7.1 with logging functionality, replaced some print() calls with _LOGGER
* updated requirements_all.txt
* Fixes issue https://github.com/XKNX/xknx/issues/51
* https://github.com/XKNX/xknx/issues/52 added raw access to KNX bus from HASS component.
* bumped version - 0.7.3 contains some bugfixes
* bumped version - 0.7.3 contains some bugfixes
* setting setpoint within climate device has to be async
* bumped version to 0.7.4
* bumped version
* https://github.com/XKNX/xknx/issues/48 Adding HVAC support.
* pylint suggestions
* Made target temperature and set point required attributes
* renamed value_type to type within sensor configuration
* Issue https://github.com/XKNX/xknx/issues/52 : added filter functionality for not flooding the event bus.
* suggestions by pylint
* Added notify support for knx platform.
* logging error if discovery_info is None.
* review suggestions by @armills
* line too long
* Using discovery_info to notifiy component which devices should be added.
* moved XKNX automation to main level.
* renamed xknx component to knx.
* reverted change within .coveragerc
* changed dependency
* updated docstrings.
* updated version of xknx within requirements_all.txt
* moved requirement to correct position
* renamed configuration attribute
* added @callback-decorator and async_prefix.
* added @callback decorator and async_ prefix to register_callbacks functions
* fixed typo
* pylint suggestions
* added angle position and invert_position and invert_angle to cover.knx
* typo
* bumped version within requirements_all.txt
* bumped version
* Added support for HVAC controller status
* Tado Fix#8606
Handle case where 'mode' and 'fanSpeed' are missing JSON. Based on
changes in commit
adfb608f86
* Expose hue group 0 to HA #8652
If allow_hue_groups is set expose "All Hue Lights" group for "special
group 0". This does add an additional Hue API call for every refresh
(approx 30 secs) to get the status of the special group 0 because it's
not included in the full API pull that currently occurs.
* Revert "Expose hue group 0 to HA #8652"
This reverts commit db7fe47ec7.
* Expose hue group 0 to HA #8652
If allow_hue_groups is set expose "All Hue Lights" group for "special
group 0". This does add an additional Hue API call for every refresh
(approx 30 secs) to get the status of the special group 0 because it's
not included in the full API pull that currently occurs.
* Changes per review by balloob
1) Use all_lights instead of all_lamps
2) Fix line lengths and trailing whitespace
3) Move "All Hue Lights" to GROUP_NAME_ALL_HUE_LIGHTS constant
* Make "All Hue Lights" a constant
* Fix trailing whitespace
* [light.tradfri] Support for pytradfri version supporting full white spectrum
* [light.tradfri] Checkout pytradfri master
* Developer docker image adjusted
* [light.tradfri] pytradfri 2.2 support for white spectrum bulbs
* Removed fix already included in dev
* Style adjusted
* pylint false positive overriden
* Review remarks applied (#1)
* make pylint happy
* Review remarks
* Adds support for the Xiaomi Philips LED Ball and Ceiling Lamp
* Documentation url updated.
* New component to .coveragerc added.
* Unused import removed.
* translate labeled as static method.
* Mixed parameters in log message fixed.
* Order of requirements_all.txt fixed.
* Plattform updated. It's async now.
* Simplifiable if-statement fixed.
* Some more clean-up of unneeded stuff.
* Platform schema updated.
* Component is called xiaomi_philipslight now.
* Requirements all updated.
* Initialization of some variables updated.
* Raise PlatformNotReady exception if light cannot be discovered.
* Import of math removed.
Missing space added.
* Remove unnecessary updates
* Refactor mysensors callback and add validation
* Add mysensors entity class. The mysensors entity class inherits from
a more general mysensors device class.
* Extract mysensors name function.
* Add setup_mysensors_platform for mysensors platforms.
* Add mysensors const schemas.
* Update mysensors callback and add child validation.
* Remove gateway wrapper class.
* Add better logging for mysensors callback.
* Add discover_persistent_devices function.
* Remove discovery in mysensors component setup.
* Clean up gateway storage in hass.data.
* Update all mysensors platforms.
* Add repr for MySensorsNotificationDevice.
* Fix bug in mysensors climate target temperatures.
* Clean up platforms. Child validation simplifies assumptions in
platforms.
* Remove not needed try except statements. All messages are validated
already in pymysensors.
* Clean up logging.
* Add timer debug logging if callback is slow.
* Upgrade pymysensors to 0.11.0.
* Make dispatch callback async
* Pass tuple device_args and optional add_devices
* Also return new_devices as list instead of dictionary.
* cast strings to integers for hsv_to_rgb conversion, fixes#6473
* remove type_checking, flake8 does not like that.
* use hsv_to_rgb to convert to correct rgb value
* Support changing the bulb color for tplink smartbulbs, related to #8766
* existence of ATTR_RGB_COLOR in kwargs, not just its existence...
* return modified supported features
* rgb-hsv conversion utils from hass return bogus values (at least for this device), so doing conversions directly with colorsys
* add typing & documentation for color model conversions
* make linters happy
* cast hsv to integer before passing it to the backend library
* make sure the bulb is on before adjusting the other settings
* allow floats as inputs for conversions, return always integers
* use typing hint in the parameter list instead of at assignment
* do not assign local color state inside turn_on, but let update handle doing it
* use forward declaration for typing, fixes travis requirements build hopefully
* rename hsv and rgb
* remove type-checking check, forward declarations should work just fine without it
* disable (broken) pylint warnings, these can be removed after astroid is updated from 1.4.9 to 1.5
* Get full multizone state during registration
We used to rely on the periodic update to get the state of each zone, only
establishing the number of zones during registration. This resulted in errors
if the current state was needed for a partial color change before the first
async_update happened.
Now we do a full update before adding the light. Thus async_update can no
longer assume device.color_zones to be defined and must instead use the
response message to decide the total number of zones.
* Insist on getting the initial state
If a response to the initial state query is lost we used to just carry on.
This resulted in type errors when we next tried to access the undefined state.
After this commit the light is not added before we have the full state.
This scenario mostly happens when something is misbehaving and the type errors
were actually useful in figuring out what happend. So an error message is
logged in their place.
* Remove lint
* Add support for Automatic OAuth2 authentication
* Fix async conversion of configurator
* Rename method for async
* Use hass.components to get configurator component
* Fix typo
* Move session data to hidden directory
* Make configurator callback optional
* LIFX: improve performance of multi-light transitions
To avoid hub overload, the light.turn_on call will change each light
sequentially.
As LIFX has no hub we can safely increase performance by starting all
light transitions concurrently.
* Improve state updates after light changes
The light.turn_on call will set a new state and then immediately read it
back. However, reading the state of a LIFX light right after a state
change can still return the old value.
To handle this situation we have previously delayed the update request a
little while to allow a potential state change to settle. Because light
updates are now run in parallel, this delay might be too short when many
lights are set at once.
This commit introduces a per-light Lock to make it explicit when the
state cannot yet be trusted.
We must then do the state update ourselves. This was already done at the
end of a long transition and that code can be reused for also doing the
update at the start of a transition.
* Add mochad light component
This commit adds a new component to control x10 dimmers/lights with
mochad.
* Create comm_type and address constants
The comm_type and address conf constants are shared between all mochad
devices because they are required information used for configuring a
device. This commit moves the definition into const.py so they're
consistent between all component types.
* flux_led: support for property "available"
* Implemented changes from code review
* Implemented changes from code review
* Implemented changes from code review
* Add new component for TPLink light bulbs.
* Update with result of gen_requirements_all.
* Add new component light.tplink.
* Move I/O outside of properties as per https://goo.gl/Nvioub.
* Make aiolifx modules easily available
* Use aiolifx features_map for deciding bulb features
Also move the feature detection out of Light so it is available even
during the initial detection.
* Move each LIFX light type to a separate class
* Simplify AwaitAioLIFX
This has become possible with recent aiolifx that calls the callback even
when a message is lost.
Now the wrapper can be used also before a Light is added though the register
callback then has to become a coroutine.
* Refactor send_color
* Add support for multizone
This lets lifx_set_state work on individual zones.
Also update to aiolifx_effects 0.1.1 that restores the state for individual
zones.
The default aiolifx timers are tuned for a network with few lost packets.
This means that lights can become "unavailable" from just a two second
dropout. An unavailable light is completely useless for HA until it is
rediscovered so this is an undesirable state to be in.
These tweaks make aiolifx try harder to get its messages through to the
bulbs, at the cost of some latency in detecting lights that actually are
unavailable.
bellows 0.3.0 changes the API to have both, renaming the attribute which used
to be for input clusters in the process.
This is in preparation for remotes.
The upstream Avion and Decora code has changed to punt retry logic out to
consumers, so update to match. As a bonus, Avion also gains support for
pulling switch configuration off the web rather than requiring manual
configuration.
* LIFX: Move light effects to external library
This moves the LIFX light effects to the external library aiolifx_effects.
To get the light state synchronized between that library and HA, the LIFX
platform no longer maintains the light state itself. Instead, it uses the
cached state that aiolifx maintains.
The reorganization also includes the addition of a cleanup handler.
* Fix style
* Configurable fade-out behavior
Adds a per-group "fade" option with values of "out" (default) or "none".
By default, the lights are faded out when turned off, but this can cause usability issues when manually switching wall switches, since the bulbs turn back on at minimum brightness.
* Changed fade value from enum to boolean
* No need to fall back to default since voluptuous takes care of that.
* Fix lights issue #8098
* Don't check self._color to decide whether to calll get_color()
self._color is None on init, so get_color() will never be called.
* Use standard entity_ids for zwave entities
* Include temporary opt-in for new entity ids
* Update link to blog post
* Update tests
* Add old entity_id as state attribute
* Expose ZWave value details
* Update tests
* Also show new_entity_id
* Just can't win with this one
* blink: the existing 50/50 flashing between base color and effect color
* breathe: a lifx_effect_breathe replacement
* ping: mostly base color with a short flash at the end of the cycle
* strobe: dark base color and short cycles by default
* solid: temporary color change, base color never visible
Adding a service call for each mode is a bit extravagant so instead
lifx_effect_breathe has been folded in as an option and that service
call is deprecated.
* Add color_util.color_hsv_to_RGB
* Use helper functions for LIFX conversions
The LIFX API uses 16 bits for saturation/brightness while HA uses 8 bits.
Using helper functions makes the conversion a bit nicer and less prone
to off-by-one issues.
The colorsys library uses 0.0-1.0 but we can avoid that by using the HA
color_util converters instead.
* osram lightify removed duplicated set in case of brightness changes
* lightify component: anticipate brightness evaluation to handle unconsidered scenario described in the PR request comments (light turned on with color/temperature)
* Correction for travis ci error:
undefined name 'transition'
* Added effects to Yeelight bulbs
* Fix Typo and Use randint instead of randrange
* Added Effects
* updated requirements_all.txt
* fix empty line
* minor fixes
* fix passing effects as parameter
* starting light template component
* linting/flaking
* starting unit tests from copypasta
* working on unit testing
* forgot to commit the test
* wrapped up unit testing
* adding remote back
* updates post running tox
* Revert "adding remote back"
This reverts commit 852c87ff96.
* adding submodule back from origin
* updating submodule
* removing a line to commit
* re-adding line
* trying to update line endings
* trying to fix line endings
* trying a different approach
* making requested changes, need to fix tests
* flaking
* union rather than intersect; makes a big difference
* more tests passing, not sure why this one's failing
* got it working
* most of the requested changes
* hopefully done now
* sets; the more you know
The product type is already established in order to decide the Kelvin range
so just reuse that information to disable color features for white-only lights.
Also change the breathe/pulse effects to be more useful for white-only
bulbs. For consistency, color bulbs set to a desaturated (i.e. white-ish)
color get the same default treatment as white-only bulbs.
* Refactor color profiles to a class
* Refactor into preprocess_turn_on_alternatives
* LIFX: use light.preprocess_turn_on_alternatives
This avoids the color_name duplication and gains support for profile.
* Add kelvin parameter to light.turn_on
* Add brightness_pct parameter to light.turn_on
* LIFX: accept brightness_pct in effects
* Add test of kelvin/brightness_pct conversions
* Move service helpers to LifxManager
* Add lifx_set_color
This is a synonym for light.turn_on except it does not actually turn on the
light unless asked to.
Thus, turn_on can be implemented just by asking.
* Rename set_color to set_state
* Support power=False with lifx_set_state
* ps - do not install all dependencies
* Comment out blinkt because it depends on GPIO
* Add pip upgrade check back
* Disable import error blinkt
* Update comment
* Fix comment
The hue is now a float but the hsbk conversion still believed it to be
an integer that could not be larger than 359. The float can in fact be,
for example, 359.9 and this would cause an out-of-bounds error in the
set_color call.
For completeness, the initial hue is also changed to a float.
Recent aiolifx allow sending messages to unregistered devices (as a
no-op). This is handy because bulbs can disappear anytime we yield and
constantly testing for availability is both error-prone and annoying.
So keep the aiolifx device around until a new one registers on the same
mac_addr.
* Added osramlighrify groups.
Allows you to make use of the build in osram lightify groups. Group states get
handeled similar as in the case of phillips hue. A lightify group shows up as
light in the homeassistant webinterface. If one light of the
group is on, the complete group is considered to be on.
To use this feature, first define some groups within your lighrify bridge, then
set add `allow_lightify_groups=true` to you osramlightify config.
It might look like:
````yaml
- platform: osramlightify
host: IP-ADDRES
allow_lightify_groups: true
```
* Fixed Pylint errors.
* Included requests.
* Included more requests.
* Fixed setup bridge and removed _light attribute.
* Update osramlightify.py
Forcing a refresh will log a warning if the periodic async_update happens
to be running already.
So let's do the refresh locally and remove the force_refresh.
State restoration takes up to a second because bulbs can be slow to react.
During this time an effect could keep running, overwriting the state that we
were trying to restore.
Now the effect forgets the light immediately and it thus avoids further
changes while the restored state settles.
This clears the internal cache in case polling picked up the state as set by
an effect.
For example, aborting an effect by selecting a new brightness could keep a
color set by the effect.
This allows for more of a disco mode where lights change so fast that you
actually notice it.
Also change the valid period to the maximum 20 msgs/sec that LIFX bulbs
can handle.
First, move the default away from turn_on so we do not have to test for
the current service.
Next, change the default color away from random. The new default is that
saturated colors will flash white and desatured colors will flash to their
fully satured color. Always with full brightness.
After many experiments, this was the method that best produced results that
are both visually pleasing and always noticeable as a flash.
* light.sensehat: adding plugin to control the 8x8 LED matrix on a Sense Hat
* add new .coveragerc entry
* light.sensehat: formatting and removing unused import
* light.sensehat: add to requirements list
* light.sensehat: update docstrings to the linter's specs
* light.sensehat: add a bit more docstring
* Remove global limit on white light temperature
Here are the supported temperatures of some popular bulbs:
Philips Hue: 2000K-6500K (the current 500-154 mired range)
LIFX Color 1000: 2500K-9000K
IKEA TRÅDFRI: 2200K, 2700K, 4000K
Obviously, Home Assistant cannot enforce a global limit and work properly
with all of these bulbs. So just remove the limit and leave it up to each
platform to work it out.
This commit updates the existing users and adds a clamp to Hue (where the
limit appears to have originated). It does not attempt to update other
platforms that might need extra handling of the larger range that is now
possible.
* Add min_mireds/max_mireds state attributes to lights
* Support min_mireds/max_mireds with LIFX lights
This makes more sense because the input and output brightness is the same.
We currently convert through RGB which does contain a brightness so we supply
an arbitrary value as input and discard the output.
* Default to white when setting LIFX temperature
Changing the temperature of a saturated color is possible but not very
interesting. So assume that a change of the temperature implies setting
the color to white, unless a different color is actually specified.
This makes the frontend temperature picker much more useful because it can
now be used to get away from a colored light.
* Default to a neutral white temperature when setting LIFX colors
This means that setting a particular color will always give the same output,
no matter what the temperature was previously at.
* Find brightness after colors
Now the color_temp logic will not see a changed color when setting
temperature+brightness and thus we will actually get a white light in
this situation.
The XY conversion can then not use brightness as input. This is not
an issue because XY only affects hue and saturation, not brightness. So
we can just use an arbitrary value as brightness input.
* Add a simple comment to a complex conditional
* Add support for Zigbee Home Automation
* Fewer magic numbers
* Make optional device config work
* Remove non-zha device_tracker stuff
* Always return boolean from is_on
* Only pass through JSON serializable discovery_info
* Update to bellows 0.2.4
* Fewer magic numbers in binary sensor
* Populate const structures from a function
* Update bellows to 0.2.6
* Fewer magic numbers in light
* Take all possible clusters when overriding
* Update bellows to 0.2.7
* Added initial support for tradfri group control
* Tried to keep original variable structure
* pylint and pep8 fixes
* Fixed lint error about docstring
* Removed unneeded stuff, renamed _light. Needs to be released pytradfri version.
* Better naming of variables inside add_devices call.
* avion light: Bump python-avion dependency version
The dependencies in python-avion weren't sufficiently strict. This is now
fixed, but means we need to depend on a new version.
* decora light: Bump python-decora dependency
There's a new version of python-decora with a reliability fix, so depend on
that.
* Refactor into find_hsbk
This will be useful for new methods that also have to find passed in colors.
* Add AwaitAioLIFX
This encapsulates the callback and Event that aiolifx needs and thus avoids an
explosion of those when new calls are added.
The refresh_state is now generally useful, so move it into its own method.
* Initial effects support for LIFX
These effects are useful as notifications. They mimic the breathe and pulse
effects from the LIFX HTTP API:
https://api.developer.lifx.com/docs/breathe-effecthttps://api.developer.lifx.com/docs/pulse-effect
However, this implementation runs locally with the LIFX LAN protocol.
* Saturate LIFX no color value
Now the color is "full saturation, no brightness". This avoids a lot of
temporary white when fading from the "no color" value and into a real color.
* Organize LIFX effects in classes
This is to move the setup/restore away from the actual effect, making it quite
simple to add additional effects.
* Stop running LIFX effects on conflicting service calls
Turning the light on/off or starting a new effect will now stop the running
effect.
* Present default LIFX effects as light.turn_on effects
This makes the effects (with default parameters) easily accessible from
the UI.
* Add LIFX colorloop effect
This cycles the HSV colors, so that is added as an internal way to set a
color.
* Move lifx to its own package and split effects into a separate file
* Always show LIFX light name in logs
The name is actually the easiest way to identify a bulb so just using it
as a fallback was a bit odd.
* Compact effect getter
* Always use full brightness for random flash color
This is a stopgap. When a bit more infrastructure is in place, the intention
is to turn the current hue some degrees. This will guarantee a flash color
that is both unlike the current color and unlike white.
* Clear effects concurrently
We have to wait for the bulbs, so let us wait for all of them at once.
* Add lifx_effect_stop
The colorloop effect is most impressive if run on many lights. Testing
this has revealed the need for an easy way to stop effects on all lights
and return to the initial state of each bulb. This new call does just that.
Calling turn_on/turn_off could also stop the effect but that would not
restore the initial state.
* Always calculate the initial effect color
To fade nicely from power off, the breathe effect needs to keep an
unchanging hue. So give up on using a static start color and just find the
correct hue from the target color.
The colorloop effect can start from anything but we use a random color
just to keep things a little interesting during power on.
* Fix lint
* Update .coveragerc
* Fixes issue with id mismatch when multiple devices are connected to the lutron bridge
* Updates labels
* removes no longer needed config values.
* removes no longer needed imports
* Add support for tradfri color temp
* Only return rgb_color if supported features indicate support.
* Return color_temp if supported features indicate support and dict
with allowed color temperatures exist for manufacturer.
* Add manufacturer specific supported features, with default.
* Color temperature is set from a dict of allowed pairs per
manufacturer, where kelvin is mapped to hex_color. When a user sets a
color temperature, the closest matching temperature is selected and
set.
* Clean up
* Cache the name of LIFX lights
After #7031 the LIFX device will change during an unregister/register
transition. This has the user-visible effect of the new device missing
a friendly name until the next poll.
We now cache the name internally and it will then transfer to the new
device when it registers.
* Allow LIFX logging even without an available device
This will allow us to set the device to None when it unregisters.
* Calculate LIFX availability from the existence of a device
This has become possible because the device is no longer needed
to provide the name of the light when it is unavailable.
We just have to forget the device when it unregisters.
* Make Tradfri discoverable
* Fix lint errors
* Fix bugs and clean up calls to light_control
* Add more color util tests
* Add coap client to dockerfile
* After rebase and all fixes
* Added color_rgb_to_hex to util.color
* Added test_color_rgb_to_hex
* Changed reference to color_rgb_to_hex
* Bumped to pytradfri 0.5, having support for retry
* Bumped to pytradfri 0.5, having support for retry
* Bumped to pytradfri 0.5, having support for retry
* Bumped to pytradfri 0.5, having support for retry
* Rolled back to 0.4
* Rolled back to 0.4
* Added initial support for IKEA Tradfri Gateway
* Pinned requirement
* Fixed lint-errors
* Added file to .coveragerc
* Trying to fix commit
* Fixed requirements_all again
* Minor reorder of code
* Minor reorder of code
* Made the changes suggested by @balloob
* Made the changes suggested by @balloob and removed debug
* Update tradfri.py
* Plug file leak on LIFX unregister
The aiolifx 0.4.4 release closes its socket when the unregister callback is
called. This plugs a file descriptor leak but also means that we must be
careful to not use the device after it goes unavailable.
Also, when a light reappears, it has a new device that must be used.
* Do not test self.available in service calls
The core will learn to handle that.
* Fire EVENT_HOMEASSISTANT_START automations off right away while starting
* Actually have core state be set to 'starting' during boot
* Fix correct start implementation
* Test and deprecate event automation platform on start
* Fix doc strings
* Remove shutting down exception
* More strict when to mark an instance as finished
* Add automation platform to listen for start/shutdown
* When we stop we should wait till it's all done
* Fix testing
* Fix async bugs in tests
* Only set UVLOOP when hass starts from CLI
* This hangs normal asyncio event loop
* Clean up Z-Wave node entity test
* Add legacy LIFX platform for Windows support
The async platform introduced in 9ef084d903 has
turned out to use Python functionality that is not available in Windows.
This commit restores the previous implementation, now named lifx_legacy.
* Add a comment about the platform being a legacy implementation
* Warn when using unsupported lifx platform on Windows
* Update .coveragerc
* Add support for group commands (allon/alloff).
Add 'group_aliasses' config attribute that only respond to group commands.
Add nogroup_aliases that only respond to 'on' 'off' commands.
Allow settings device id group behaviour.
* Fix linting.
* Fix lint.
* yeelight: adjust supported features on update()
Earlier we checked for the type only during the initialization,
but this won't work when the bulb is disconnected during the init,
causing failures to adjust rgb&color temperature even if those should be supported.
fixes#6692
* Use reassign instead of OR for updating the supported features
* Add link to docs and remove comments which are obvious
* Update docstrings
* Repleace conf details with link to docs
* Add link to docs
* Update docstrings
* Update import
* Update ordering
* Update ordering
* Update docstring
* Update ordering
* Update ordering
Addressing #6382 . Feedback from github & forums is the bridge_led feature never worked and defining the bridge LED as another group+bulb type is the right way to do this in the limitlessled component.