Skip to content

Color temperature for lights#154

Merged
Julius2342 merged 12 commits into
XKNX:masterfrom
farmio:color-temperature
Dec 28, 2018
Merged

Color temperature for lights#154
Julius2342 merged 12 commits into
XKNX:masterfrom
farmio:color-temperature

Conversation

@farmio
Copy link
Copy Markdown
Member

@farmio farmio commented Oct 7, 2018

added support for absolute and relative color temperature functions of lights.

'tunable_white' sets the relative color temperature in %
'color_temperature' sets the absolute color temperature in Kelvin

this PR supersedes #153

@coveralls
Copy link
Copy Markdown

coveralls commented Oct 7, 2018

Coverage Status

Coverage increased (+0.2%) to 89.245% when pulling 8b4d345 on farmio:color-temperature into b5d8be0 on XKNX:master.

@farmio
Copy link
Copy Markdown
Member Author

farmio commented Nov 11, 2018

I don't know why the coveralls coverage decreased. Everything I have added should have tests as well.
I haven't touched the files reported for decreasing coverage:
xknx/devices/notification.py and
xknx/devices/action.py

@Julius2342
Copy link
Copy Markdown
Collaborator

Coveralls sometims does not like us :)

(im pretty busy with some 35C3 stuff atm, but will have a look at your MR asap...)

@marvin-w
Copy link
Copy Markdown
Member

@farmio: Can you please update this PR so that it is up to date with the master branch? :)

Copy link
Copy Markdown
Member

@marvin-w marvin-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farmio Thank you for the PR. Please merge the current master in your remote branch and take care of the review comments (where needed). I'd then merge it and take care of the PR at HA.

It would be great if you could retest this since at least I am unable to test this without the appropriate devices.

from homeassistant.helpers.script import Script

REQUIREMENTS = ['xknx==0.8.5']
REQUIREMENTS = ['xknx==0.9.0']
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this from the PR. The current version will be 0.9.3 and we will merge it from HA directly into XKNX.

Comment thread xknx/devices/remote_value_sensor.py
Comment thread tox.ini
PYTHONPATH = {toxinidir}
commands =
py.test --cov --cov-report= {posargs}
whitelist_externals = make
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it tox throws a warning:
pylint runtests: commands[0] | make pylint WARNING: test command found but not installed in testenv cmd: /usr/bin/make env: /Users/meti/Documents/Dev/xknx/.tox/pylint Maybe you forgot to specify a dependency? See also the whitelist_externals envconfig setting.
on my system. Same for
pydocstyle runtests: commands[0] | make pydocstyle

Copy link
Copy Markdown
Member Author

@farmio farmio Dec 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be the reason for the decreased coverage? These warnings occurred with the travis tests of the latest PR #161 too.
See for example https://travis-ci.org/XKNX/xknx/jobs/471596429 line 589 ff.
cc @Julius2342

@farmio
Copy link
Copy Markdown
Member Author

farmio commented Dec 27, 2018

I have tested it with Home-Assistant 0.84.6 and it works properly with an MDT Led Controller AKD-0424R.02

The only error was

File "***/.homeassistant/custom_components/climate/xknx.py", line 72, in
vol.Optional(CONF_MIN_TEMP): cv.Coerce(float),
AttributeError: module 'homeassistant.helpers.config_validation' has no attribute 'Coerce'

but I haven't touched that file.

@marvin-w
Copy link
Copy Markdown
Member

@farmio Thanks for your fast feedback. We somehow need to get rid of those coverage "errors". I already fixed the error in climate.py in this PR: home-assistant/core#19546.

I will merge the changes into our project once the PR is merged.

There seem to be a lot of changes in this PR that are not related to the actual code changes. Can you fix this please?

@farmio
Copy link
Copy Markdown
Member Author

farmio commented Dec 27, 2018

Never mind. I have done another rebase and force-pushed it. Seems good now.

I don't really know how these changes got in here. They are not visible at master...farmio:color-temperature . Maybe something went wrong when I did the git rebase upstream/master.
What can I do about it? Shall I create a new PR?

Also I am not entirely sure if ATTR_WHITE_VALUE and SUPPORT_WHITE_VALUE are the best choices for relative color temperature settings. I couldn't find documentation about this back in October.
It works, but maybe it will conflict with RGBW lights once they get implemented in xknx. I don't really know if tunable white is a thing with RGBW.

- added tunable white function for setting relative color temperature for lights
- tests for tunable white function
- whitelist 'make' for tox
- removed double whitespace in device.py
- added color temperature function for setting absolute color temperature values for lights
- added tests for color remperature function
- reordered DPTMAP in remote_value_sensor.py by DPT number
- added DPTColorTemperature class for DPT 7.600
- added color temperature for home assistant plugin
- added min and max kelvin / mireds
- removed unused import
- bumped required version of xknx in ha-plugin
- disabled pylint too-many-locals warning in light.py
- added color temperature function for setting absolute color temperature values for lights
- added tests for color remperature function
- reordered DPTMAP in remote_value_sensor.py by DPT number
- added DPTColorTemperature class for DPT 7.600
- added color temperature for home assistant plugin
- added min and max kelvin / mireds
- removed unused import
- bumped required version of xknx in ha-plugin
- disabled pylint too-many-locals warning in light.py
Avoid triple conversion while comparing against min / max color temperature when a new value is set.
@marvin-w
Copy link
Copy Markdown
Member

@farmio thanks for updating the PR. I will take another look tomorrow when I'm back home!

@Julius2342 Julius2342 merged commit b26b8a8 into XKNX:master Dec 28, 2018
@Julius2342
Copy link
Copy Markdown
Collaborator

🐬

@farmio farmio deleted the color-temperature branch December 28, 2018 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants