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