Commit Graph

19 Commits (dc01b1726050fd379f544244d92e1b1c471ac37b)

Author SHA1 Message Date
Anders Melchiorsen ef3a83048c
Throttle unavailability warnings for tplink light/switch (#15591) 2018-07-22 00:51:45 +02:00
Teemu R 5cf9cd686c light.tplink: initialize min & max mireds only once, avoid i/o outside update (#15571)
* light.tplink: initialize min & max mireds only once, avoid i/o outside update

* revert the index change

* fix indent, sorry for overwriting your fix, balloob
2018-07-20 14:40:10 +02:00
Thibault Cohen a729742757 Fix tplink max/min kelvin for temperature adjustment (#15020) 2018-06-20 19:29:36 +02:00
Teemu R 5898307715 Bump pyhs100 version (#15001)
Fixes #13925
2018-06-16 15:52:03 -04:00
Anders Melchiorsen e6d4501ee3 Fix color setting of tplink lights (#14108) 2018-04-28 17:12:11 -04:00
Adam Mills 89c7c80e42 Use hue/sat as internal light color interface (#11288)
* Accept and report both xy and RGB color for lights

* Fix demo light supported_features

* Add new XY color util functions

* Always make color changes available as xy and RGB

* Always expose color as RGB and XY

* Consolidate color supported_features

* Test fixes

* Additional test fix

* Use hue/sat as the hass core color interface

* Tests updates

* Assume MQTT RGB devices need full RGB brightness

* Convert new platforms

* More migration

* Use float for HS API

* Fix backwards conversion for KNX lights

* Adjust limitless min saturation for new scale
2018-03-18 15:00:29 -07:00
Otto Winter 678f284015 Upgrade pylint to 1.8.2 (#12274)
* Upgrade pylint to 1.8.1

* Fix no-else-return

* Fix bad-whitespace

* Fix too-many-nested-blocks

* Fix raising-format-tuple

See https://github.com/PyCQA/pylint/blob/master/doc/whatsnew/1.8.rst

* Fix len-as-condition

* Fix logging-not-lazy

Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string

* Fix stop-iteration-return

* Fix useless-super-delegation

* Fix trailing-comma-tuple

Both of these seem to simply be bugs:
 * Nest: The value of self._humidity never seems to be used anywhere
 * Dovado: The called API method seems to expect a "normal" number

* Fix redefined-argument-from-local

* Fix consider-using-enumerate

* Fix wrong-import-order

* Fix arguments-differ

* Fix missed no-else-return

* Fix no-member and related

* Fix signatures-differ

* Revert "Upgrade pylint to 1.8.1"

This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.

* Fix arguments-differ

* except for device_tracker

* Cleanup

* Fix test using positional argument

* Fix line too long

I forgot to run flake8 - shame on me... 🙃

* Fix bad-option-value for 1.6.5

* Fix arguments-differ for device_tracker

* Upgrade pylint to 1.8.2

* 👕 Fix missed no-member
2018-02-11 09:20:28 -08:00
Ville Skyttä 384f63dd1d Typing fixes (#12015)
* .gitignore: Add .mypy_cache

* Typing fixes
2018-01-29 00:24:08 -08:00
Dan Nixon 020593d509 Override default name for TP-Link devices (#11710)
Fixes #11706

Corrects a bug introduced that prevents the names of TP-LInk devices
from being pulled from the devices themselves.
2018-01-17 00:52:32 -08:00
Dan Nixon fcbf7abdaa Reverts unit conversions in TP-Link bulb (#11381)
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.
2017-12-31 15:58:22 +01:00
Dan Nixon 2a2e6b6334 Correct units used in TP-Link energy monioring (#10979)
* 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.
2017-12-29 13:13:15 +01:00
Dan Nixon a6c7fe04da Add default names and validation for TP-Link devices (#11346)
Adds missing platform schema for TP-Link smart sockets and adds default
names for smart sockets and bulbs.
2017-12-28 21:22:46 +01:00
Dan Nixon aeba81e193 Report availability for TP-Link smart bulbs (#10976) 2017-12-12 17:18:46 +01:00
Sean Gollschewsky 6ea866c7f7 Add emeter attributes (#9903)
* 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.
2017-10-18 21:52:44 -07:00
Teemu R e19e9a1f2b switch.tplink, light.tplink: bump the pyhs100 version and adapt to api changes (#9454)
* 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
2017-10-08 17:31:32 +03:00
Teemu R 90fb33f610 Support changing the bulb color for tplink smartbulbs, fixes #8766 (#8780)
* 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
2017-08-22 22:11:44 -07:00
Sean Gollschewsky 9919eec596 Fix brightness issue #8744. (#8755) 2017-07-31 09:02:04 -07:00
Sean Gollschewsky 431a381c8d Move I/O outside of properties for light/tplink platform (#8699)
* 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.
2017-07-29 21:53:37 -07:00
Sean Gollschewsky e83816c055 Add component Light TPLink (#8643)
* Add new component for TPLink light bulbs.

* Update with result of gen_requirements_all.

* Add new component light.tplink.
2017-07-26 09:04:40 +02:00