Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for automatic discovery of TP-Link switches, bulbs and dimmers #18091

Merged
merged 42 commits into from Feb 21, 2019

Conversation

@rytilahti
Copy link
Contributor

rytilahti commented Nov 1, 2018

Description:

This is a continuation of #15329 and adds support for automatic discovery of TP-Link bulbs, switches, and dimmers based on the new config flow. The integration needs to be enabled either in the integration configuration or alternatively by adding tplink component to the configuration file. As the devices are now configured on the component, this is a breaking change for light.tplink and switch.tplink.

Other changes:

  • Support for HS220 dimmers (these are internally switches which have a light-like interface)
  • Support for device info
  • Platforms are now embedded inside the component
  • Removal of enable_leds configuration. I doubt its usefulness as a static configuration variable, but if someone wants to really have that, supporting that feature should be done by introducing a service to change its value.
  • Fixes HSV setting for lights (hue was previously capped to 359 degrees)

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7338

Example entry for configuration.yaml (if applicable):

tplink:
  discovery: true
  light:
    - host: 192.168.xx.xx
    - host: 127.0.0.1
  switch:
    - host: 192.168.xx.xx

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
Show resolved Hide resolved homeassistant/components/tplink/__init__.py Outdated
Show resolved Hide resolved homeassistant/components/tplink/__init__.py Outdated
Show resolved Hide resolved homeassistant/components/tplink/__init__.py Outdated
Show resolved Hide resolved homeassistant/components/tplink/__init__.py Outdated
Show resolved Hide resolved homeassistant/components/light/tplink.py Outdated
@rytilahti

This comment has been minimized.

Copy link
Contributor Author

rytilahti commented Nov 1, 2018

I will add documentation soon. @balloob what types of tests the configuration flow requires?

@balloob

This comment has been minimized.

Copy link
Member

balloob commented Nov 1, 2018

all steps of the config flow need to be tested to make sure the data comes in and out as expected.

Show resolved Hide resolved homeassistant/config_entries.py Outdated

@rytilahti rytilahti referenced this pull request Nov 2, 2018

Merged

Add documentation for TP-Link Smart Home devices #7338

2 of 2 tasks complete
"""Return information about the device."""
return {
'identifiers': {
(TPLINK_DOMAIN, self.unique_id)

This comment has been minimized.

@balloob

balloob Nov 3, 2018

Member

Remove this. It's not a TP Link provided identifier, it's a Mac address and it's already provided as a connections.

This comment has been minimized.

@rytilahti

rytilahti Nov 3, 2018

Author Contributor

Ok, I removed it. There is also two identifiers which could be used here if wanted: deviceId and hwId, but that probably doesn't change anything if the mac is already there?

@balloob

This comment has been minimized.

Copy link
Member

balloob commented Nov 3, 2018

Really looking forward to this PR ! 🎉 Cheap switches for everyone

@balloob balloob changed the title WIP: Add support for automatic discovery of TP-Link switches, bulbs and dimmers Add support for automatic discovery of TP-Link switches, bulbs and dimmers Nov 5, 2018

rytilahti added some commits Jan 19, 2019

Test unloading for all platforms, clear the data storage instead of p…
…opping it out, making it possible to reconfigure after removal without restarting hass first
Run black on test_init, hopefully that will finally fix the weird for…
…matting (pycharm, pylint and hound seems to have different opinions...)

@balloob balloob force-pushed the rytilahti:tplink_unique_id branch from 9e4a18b to 1239c30 Feb 21, 2019

@balloob
Copy link
Member

balloob left a comment

Rebased it, ok to merge when tests pass 🎉

@MartinHjelmare MartinHjelmare merged commit 94be43e into home-assistant:dev Feb 21, 2019

3 checks passed

Hound No violations found. Woof!
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wafflebot wafflebot bot removed the in progress label Feb 21, 2019

SukramJ added a commit to SukramJ/home-assistant that referenced this pull request Feb 21, 2019

pull from origin (#1)
* Add legacy PLATFORM_SCHEMA config validation

* Fix tests

* Lint

* Add persistent notification

* Update bootstrap.py

* Fix battery_level error - HomeKit (home-assistant#21120)

* Remove outdated url pattern match support for static file hosting (home-assistant#21109)

* Upgrade pytest to 4.2.1 (home-assistant#21112)

* Upgrade pytest to 4.2.0

* Upgrade pytest to 4.2.1

* Make litejet switch test work with pytest 4.2

* Make Netatmo able to discover both Weather station and Health Coach (home-assistant#20274)

* Resolve conflicts and review comments

* Corretly handle HomeCoach in manual setup

* Fix code reivew comments

* Move import back int methods

* Formatting fix

* Lint fix

* Return None if no GTFS departures found (home-assistant#20919)

* Add webhook support for Netatmo Cameras (home-assistant#20755)

Add webhook support for Netatmo Cameras

* Logging to find what deCONZ events get created (home-assistant#20551)

* Helpful logging to easily find what events get created

* Add traccar scan_interval configuration option (home-assistant#21079)

* Added scan_interval configuration option

* Fixed trailing whitespace and indentation

* Update traccar.py

* Update homeassistant/components/device_tracker/traccar.py

Co-Authored-By: lapy <lapy@users.noreply.github.com>

* Add component media player.ps4 (home-assistant#21074)

* Added PS4/ __init__.py

* Create en.json

* Create config_flow.py

* Create const.py

* Create media_player.py

* Create services.yaml

* Create strings.json

* Create __init__.py

* Add test_config_flow.py/ Finished adding PS4 files

* Rewrote for loop into short-hand

* bumped pyps4 to 0.2.8

* Pass in helper()

* Rewrite func

* Fixed test

* Added import in init

* bump to 0.2.9

* bump to 0.3.0

* Removed line

* lint

* Add ps4 to flows list

* Added pyps4-homeassistant with script

* Added pyps4

* Added pypys4 to test

* removed list def

* reformatted service call dicts

* removed config from device class

* typo

* removed line

* reformatted .. format

* redefined property

* reformat load games func

* Add __init__ and media_player.py to coveragerc

* Fix for test

* remove init

* remove blank line

* remove mock_coro

* Revert "remove init"

This reverts commit b68996a.

* Correct permissions

* fixes

* fixes

*  Add traccar monitored_conditions option (home-assistant#21149)

* Add traccar monitored_conditions option

User defined additional parameters to track from the traccar platform

* Version bump for pytraccar client

* Update traccar.py

* Remove default value

* Update homeassistant/components/device_tracker/traccar.py

Co-Authored-By: lapy <lapy@users.noreply.github.com>

* Update traccar.py

* RSSI_PEER and RSSI_DEVICE are different things (fixes home-assistant#20900) (home-assistant#20902)

* Fix home-assistant#20900: RSSI_PEER and RSSI_DEVICE are different things

This change is fixing issue home-assistant#20900.

Wireless actors are having two RSSI values. The way the component was programmed one of them was overwritten.

* Added deprecation comment

* Fixed long line

* Fix: pylint comment

* Lint

* flake8

* flake8 again

* Update __init__.py

* Fix track_change error in utility_meter (home-assistant#21134)

* split validation

* remove any()

* Upgrade voluptuous-serialize to 2.1.0 (home-assistant#21166)

* Upgrade youtube_dl to 2019.02.18 (home-assistant#21164)

* Upgrade sqlalchemy to 1.2.18 (home-assistant#21162)

* Update pyEight for Python 3.7 Compatability (home-assistant#21161)

* Upgrade psutil to 5.5.1 (home-assistant#21171)

* Fix HomematicIP Cloud fix cover position property (home-assistant#21154)

* Clean up upc_connect tests (home-assistant#21150)

* Add power source to device and clean up zha listeners (home-assistant#21174)

check available and add comments

ensure order on API test

* deCONZ thermostat support (home-assistant#20586)

* Add support for thermostats in deCONZ by adding Climate platform

* Make sure that device trackers is always a list during creation (home-assistant#21193)

* Fix for home-assistant#19072 (home-assistant#21175)

* Fix for home-assistant#19072

PR home-assistant#19072 introduced the custom_effect feature but it didnt make it optional as the documentation states.
This causes error on startup and the component does not work.
```
Error while setting up platform flux_led
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/flux_led.py", line 135, in setup_platform
    device[CONF_CUSTOM_EFFECT] = device_config[CONF_CUSTOM_EFFECT]
KeyError: 'custom_effect'
```

Changing this line to make the custom_effect optional as the original intention.

* Update flux_led.py

* Add context to service call event (home-assistant#21181)

* Updated frontend to 20190218.0

* Expose effect_list attribute for turned off lights (home-assistant#20750)

* Upgrade aioimaplib for Python 3.7 compatibility (home-assistant#21197)

* Philips Hue: Add bridge update prompt (home-assistant#21119)

* Add a prompt if bridge update is available.

* Change logger warning for light update

The self.light.swupdatestate only checks for updates of that specific light, it does not check for updates of the bridge.
Theirfore the warning message schould be updated.

* add space

* fix tests

* rename to swupdate2_bridge_state

* update aiohue to v1.9.1

* update aiohue to v1.9.1

* update aiohue to v1.9.1

* Upgrade crimereports to 1.0.1 (home-assistant#21187)

* Netatmo, address comments from home-assistant#20755 (home-assistant#21157)

Netatmo component cleanup

* Use constants from const.py (home-assistant#21068)

* Use constants from const.py

* Fix lint issues

* Bump Synology SRM dependency to version 0.0.6 (home-assistant#21212)

* Bump Synology SRM dependency to version 0.0.6

* Add @aerialls to the Synology SRM code owners

* Upgrade numpy to 1.16.1 (home-assistant#21190)

* Set aioharmony version to 0.1.8 (home-assistant#21213)

Update aioharmony version to support latest HUB firmware (4.15.250).

* ordered by last occurence (home-assistant#21200)

* Push pyads to 3.0.7 (home-assistant#21216)

* Push to pyads 3.0.7

* Correct too long line

* Fix Homematic IP Cloud configuration (home-assistant#21202)

`homematicip.aio.auth.isRequestAcknowledged` returns false if the
request failed in stead of raising an error.

See coreGreenberet/homematicip-rest-api@0b61954

Closes: home-assistant#20428

* Refactor ZHA listeners into channels (home-assistant#21196)

* refactor listeners to channels

* update coveragerc

* Add yeelight flow action support (home-assistant#21195)

* Updated frontend to 20190219.0

* Fix the build (home-assistant#21229)

* Update pyhomematic to 0.1.56 (home-assistant#21227)

* Prevent invalid context from crashing (home-assistant#21231)

* Prevent invalid context from crashing

* Lint

* Add self to integration sensor and utility_meter (home-assistant#21226)

* Fix an Ambient PWS exception when location info is missing (home-assistant#21220)

* Add zone and reps for Xiaomi vacuum (home-assistant#19777)

* xiaomi vacuum with zone and reps

* tail whitespace

* tail whitespaces

* new version

* fix params typs

* fix param type

* line length

* rytilahti tips

* houndci-bot

* fix trevis

* rytilahti tips

* service description

* syssi fix

* MartinHjelmare tips

* MartinHjelmare

* data_template schema

* line lenght

* line lenght

* line lenght

* data_template schema

* fix

* Update homeassistant/components/vacuum/xiaomi_miio.py

Co-Authored-By: marcogazzola <dev@marcogazzola.com>

* Update homeassistant/components/vacuum/xiaomi_miio.py

Co-Authored-By: marcogazzola <dev@marcogazzola.com>

* xiaomi vacuum with zone and reps

* tail whitespace

* new version

* fix param type

* rytilahti tips

* rytilahti tips

* MartinHjelmare

* data_template schema

* line lenght

* line lenght

* data_template schema

* fix

* Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev

* Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev"

This reverts commit e1f370b.

* log fixed

* Revert "log fixed"

This reverts commit 1f0e7b3.

* Revert "Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev""

This reverts commit 1cf9e5a.

* Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev"

This reverts commit 0e8d534.

* log fixed

* Don't dispatch to components when there are no channels for ZHA sensors (home-assistant#21223)

* don't dispatch when channels don't exist

* review comment

* Fix bug in ZHA and tweak non sensor channel logic (home-assistant#21234)

* fix race condition and prevent profiles from stealing channels

* fix battery voltage

* Bump zigpy (home-assistant#21203)

* Bump zigpy

* Update requirements

* Update test requirements

* Bump zigpy-deconz

* Support OpenWRT 18.06 in luci device tracker (home-assistant#21236)

* Got it right this time i hope

* updates on comments

* Updated frontend to 20190220.0

* Remove constraint from regex (home-assistant#21239)

* Upgrade opensensemap-api to 0.1.4 (home-assistant#21240)

* Alarm trigger support for Point (home-assistant#21207)

* Prevent partial custom component overlays (home-assistant#21070)

* Prevent partial custom component overlays

* Fix tests

* Fix ZHA bugs (home-assistant#21246)

* fix bugs

* add comment

* allow entities to be marked unavailable

* Correctly detect devices, which went offline during HA restart (home-assistant#20933)

* Correctly detect devices, which went offline during HA restart

* Update __init__.py

* Update rova component with suffix for house number (home-assistant#21182)

* Update rova component with release rova release 0.1.0
Add house_number_suffix to configuration

* Set default value for house_number_suffix

* Add missing configuration option to plex (home-assistant#21264)

Fixes part of: home-assistant#21254

* Add missing configation option (home-assistant#21265)

Fixes home-assistant#21254

* Add SamsungTV Mac validation (home-assistant#21268)

* Added device tracker support for Ubee Router (home-assistant#19586)

* Added Ubee Router Device Tracker.

* Updated code to meet requirements.

* Code clean-up.

* Code clean-up.

* Code clean-up.

* Minor error message update

* Ubee device tracker: Minor code clean-up

* Bump pyubee version

* Code clean-up

* account specific cookies file to enable multiple accounts (home-assistant#19811)

* Add support for automatic discovery of TP-Link switches, bulbs and dimmers (home-assistant#18091)

* {switch,light}.tplink: use deviceid as unique id, fetch name from the device during initialization

* raise PlatformNotReady when no device is available

* Use mac instead of deviceid

* remove name option as obsolete

* Add support for configuration flow / integration

Allows activating automatic discovery of supported devices from the configuration

* Fix linting, update requirements_all.txt

* start cleaning up tplink component based on feedback

* add device info, improve config handling

* Allow overriding detected devices via configuration file

* Update requirements.txt

* Remove debug logging

* make hound happy

* Avoid I/O during init and simplify the code, remove remains of leds_on

* Fix issues based on feedback, use consistent quotation marks for device info

* add async_setup_platform emiting a deprecation warning

* Avoid blocking the I/O, check for None on features

* handle some Martin's comments, schema-validation is still missing

* use async_create_task instead of async_add_job, let core validate the schema

* simplify configuration handling by storing the configuration data separately from initialized instances

* add default values to schema, make hound happy

* with defaults set by schema, simplify the checks. add async_unload_entry

* Use constant for data structure access

* REWORD add a short note about async_unload_entry

* handle feedback from Martin, config_data is checked against Noneness

* use pop to remove the domain on unload

* First steps to add tests for the new tplink component

* embed platforms under the component directory

* Fix tests by mocking the pyhs100 internals

* Fix linting

* Test against multiple instances of devices, tidy up

* (hopefully) final linting round

* Add pyHS100 to test requirements

* log always the warnings occured during an update to make them easy to see

* revert back the warning behavior (requirement for silver level in IQS)

* Unload only when an entry is being loaded and add tests for that

Thanks @MartinHjelmare for pointing this out!

* Fix linting

* Bump the upstream lib, fixes most prominently the HSV setting on bulbs

* Test unloading for all platforms, clear the data storage instead of popping it out, making it possible to reconfigure after removal without restarting hass first

* Use class variables instead of instance variables for bulb states, required for HS220

* Use new-style format string

* Fix indenting, uppercase the mock constant

* Run black on test_init, hopefully that will finally fix the weird formatting (pycharm, pylint and hound seems to have different opinions...)

* update services.yaml (home-assistant#21276)

* Fix unhandled exception in Ambient PWS config entry (home-assistant#21278)

@rytilahti rytilahti deleted the rytilahti:tplink_unique_id branch Feb 22, 2019

SukramJ added a commit to SukramJ/home-assistant that referenced this pull request Feb 22, 2019

Home assistant dev (#3)
* Bumped version to 0.88.0b0

* Add legacy PLATFORM_SCHEMA config validation

* Fix tests

* Lint

* Add persistent notification

* Updated frontend to 20190215.0

* Set ZHA device availability on new join (home-assistant#21066)

* set availability on device join

* fix new join test

* Fix pushover schema

* Set uvloop version consistent with hass.io (home-assistant#21080)

This sets the uvloop version in Docker containers to 0.11.3, which is the
same version that hass.io uses.

uvloop might be causing issues with some Docker containers on some host
systems, as reported in home-assistant#20829

* Check against unlinked user (home-assistant#21081)

* Fix hue retry crash (home-assistant#21083)

* Fix Hue retry crash

* Fix hue retry crash

* Fix tests

* Update pychromecast (home-assistant#21097)

* Bump aioambient to 0.1.2 (home-assistant#21098)

* Bumped version to 0.88.0b1

* Update bootstrap.py

* Updated frontend to 20190216.0

* Bump thermoworks_smoke version to get new pyrebase version (home-assistant#21100)

* Fix battery_level error - HomeKit (home-assistant#21120)

* Remove outdated url pattern match support for static file hosting (home-assistant#21109)

* Don't expose services in Utility_Meter unless tariffs are available (home-assistant#20878)

* only expose services when tariffs configured

* don't register services multiple times

* Deprecate conf_update_interval (home-assistant#20924)

* Deprecate update_interval and replace with scan_interval

* Update tests

* Fix Darksky tests

* Fix Darksky tests correctly

This reverts commit a73384a.

* Provide the default for the non deprecated option

* Don't override default schema for sensors

* Add legacy PLATFORM_SCHEMA config validation

* Fix tests

* Lint

* Add persistent notification

* Update bootstrap.py

* Bumped version to 0.88.0b2

* Handle ValueError (home-assistant#21126)

* Fix battery_level error - HomeKit (home-assistant#21120)

* Bump pychromecast to 2.5.2 (home-assistant#21127)

* Upgrade pytest to 4.2.1 (home-assistant#21112)

* Upgrade pytest to 4.2.0

* Upgrade pytest to 4.2.1

* Make litejet switch test work with pytest 4.2

* Make Netatmo able to discover both Weather station and Health Coach (home-assistant#20274)

* Resolve conflicts and review comments

* Corretly handle HomeCoach in manual setup

* Fix code reivew comments

* Move import back int methods

* Formatting fix

* Lint fix

* Return None if no GTFS departures found (home-assistant#20919)

* Add webhook support for Netatmo Cameras (home-assistant#20755)

Add webhook support for Netatmo Cameras

* Logging to find what deCONZ events get created (home-assistant#20551)

* Helpful logging to easily find what events get created

* Add traccar scan_interval configuration option (home-assistant#21079)

* Added scan_interval configuration option

* Fixed trailing whitespace and indentation

* Update traccar.py

* Update homeassistant/components/device_tracker/traccar.py

Co-Authored-By: lapy <lapy@users.noreply.github.com>

* Add component media player.ps4 (home-assistant#21074)

* Added PS4/ __init__.py

* Create en.json

* Create config_flow.py

* Create const.py

* Create media_player.py

* Create services.yaml

* Create strings.json

* Create __init__.py

* Add test_config_flow.py/ Finished adding PS4 files

* Rewrote for loop into short-hand

* bumped pyps4 to 0.2.8

* Pass in helper()

* Rewrite func

* Fixed test

* Added import in init

* bump to 0.2.9

* bump to 0.3.0

* Removed line

* lint

* Add ps4 to flows list

* Added pyps4-homeassistant with script

* Added pyps4

* Added pypys4 to test

* removed list def

* reformatted service call dicts

* removed config from device class

* typo

* removed line

* reformatted .. format

* redefined property

* reformat load games func

* Add __init__ and media_player.py to coveragerc

* Fix for test

* remove init

* remove blank line

* remove mock_coro

* Revert "remove init"

This reverts commit b68996a.

* Correct permissions

* fixes

* fixes

*  Add traccar monitored_conditions option (home-assistant#21149)

* Add traccar monitored_conditions option

User defined additional parameters to track from the traccar platform

* Version bump for pytraccar client

* Update traccar.py

* Remove default value

* Update homeassistant/components/device_tracker/traccar.py

Co-Authored-By: lapy <lapy@users.noreply.github.com>

* Update traccar.py

* RSSI_PEER and RSSI_DEVICE are different things (fixes home-assistant#20900) (home-assistant#20902)

* Fix home-assistant#20900: RSSI_PEER and RSSI_DEVICE are different things

This change is fixing issue home-assistant#20900.

Wireless actors are having two RSSI values. The way the component was programmed one of them was overwritten.

* Added deprecation comment

* Fixed long line

* Fix: pylint comment

* Lint

* flake8

* flake8 again

* Update __init__.py

* Fix track_change error in utility_meter (home-assistant#21134)

* split validation

* remove any()

* Upgrade voluptuous-serialize to 2.1.0 (home-assistant#21166)

* Upgrade youtube_dl to 2019.02.18 (home-assistant#21164)

* Upgrade sqlalchemy to 1.2.18 (home-assistant#21162)

* Update pyEight for Python 3.7 Compatability (home-assistant#21161)

* Upgrade psutil to 5.5.1 (home-assistant#21171)

* Fix HomematicIP Cloud fix cover position property (home-assistant#21154)

* Clean up upc_connect tests (home-assistant#21150)

* Add power source to device and clean up zha listeners (home-assistant#21174)

check available and add comments

ensure order on API test

* deCONZ thermostat support (home-assistant#20586)

* Add support for thermostats in deCONZ by adding Climate platform

* Make sure that device trackers is always a list during creation (home-assistant#21193)

* Fix for home-assistant#19072 (home-assistant#21175)

* Fix for home-assistant#19072

PR home-assistant#19072 introduced the custom_effect feature but it didnt make it optional as the documentation states.
This causes error on startup and the component does not work.
```
Error while setting up platform flux_led
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/flux_led.py", line 135, in setup_platform
    device[CONF_CUSTOM_EFFECT] = device_config[CONF_CUSTOM_EFFECT]
KeyError: 'custom_effect'
```

Changing this line to make the custom_effect optional as the original intention.

* Update flux_led.py

* Add context to service call event (home-assistant#21181)

* Updated frontend to 20190218.0

* Updated frontend to 20190218.0

* Return None if no GTFS departures found (home-assistant#20919)

* SmartThings Component Enhancements/Fixes (home-assistant#21085)

* Improve component setup error logging/notification

* Prevent capabilities from being represented my multiple platforms

* Improved logging of received updates

* Updates based on review feedback

* Fix SmartThings Translation Error (home-assistant#21103)

* Fix track_change error in utility_meter (home-assistant#21134)

* split validation

* remove any()

* Update pyEight for Python 3.7 Compatability (home-assistant#21161)

* Add power source to device and clean up zha listeners (home-assistant#21174)

check available and add comments

ensure order on API test

* Fix for home-assistant#19072 (home-assistant#21175)

* Fix for home-assistant#19072

PR home-assistant#19072 introduced the custom_effect feature but it didnt make it optional as the documentation states.
This causes error on startup and the component does not work.
```
Error while setting up platform flux_led
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/flux_led.py", line 135, in setup_platform
    device[CONF_CUSTOM_EFFECT] = device_config[CONF_CUSTOM_EFFECT]
KeyError: 'custom_effect'
```

Changing this line to make the custom_effect optional as the original intention.

* Update flux_led.py

* Bumped version to 0.88.0b3

* Expose effect_list attribute for turned off lights (home-assistant#20750)

* Upgrade aioimaplib for Python 3.7 compatibility (home-assistant#21197)

* Philips Hue: Add bridge update prompt (home-assistant#21119)

* Add a prompt if bridge update is available.

* Change logger warning for light update

The self.light.swupdatestate only checks for updates of that specific light, it does not check for updates of the bridge.
Theirfore the warning message schould be updated.

* add space

* fix tests

* rename to swupdate2_bridge_state

* update aiohue to v1.9.1

* update aiohue to v1.9.1

* update aiohue to v1.9.1

* Upgrade crimereports to 1.0.1 (home-assistant#21187)

* Netatmo, address comments from home-assistant#20755 (home-assistant#21157)

Netatmo component cleanup

* Use constants from const.py (home-assistant#21068)

* Use constants from const.py

* Fix lint issues

* Bump Synology SRM dependency to version 0.0.6 (home-assistant#21212)

* Bump Synology SRM dependency to version 0.0.6

* Add @aerialls to the Synology SRM code owners

* Upgrade numpy to 1.16.1 (home-assistant#21190)

* Set aioharmony version to 0.1.8 (home-assistant#21213)

Update aioharmony version to support latest HUB firmware (4.15.250).

* ordered by last occurence (home-assistant#21200)

* Push pyads to 3.0.7 (home-assistant#21216)

* Push to pyads 3.0.7

* Correct too long line

* Fix Homematic IP Cloud configuration (home-assistant#21202)

`homematicip.aio.auth.isRequestAcknowledged` returns false if the
request failed in stead of raising an error.

See coreGreenberet/homematicip-rest-api@0b61954

Closes: home-assistant#20428

* Refactor ZHA listeners into channels (home-assistant#21196)

* refactor listeners to channels

* update coveragerc

* Add yeelight flow action support (home-assistant#21195)

* Updated frontend to 20190219.0

* Updated frontend to 20190219.0

* Upgrade aioimaplib for Python 3.7 compatibility (home-assistant#21197)

* ordered by last occurence (home-assistant#21200)

* Set aioharmony version to 0.1.8 (home-assistant#21213)

Update aioharmony version to support latest HUB firmware (4.15.250).

* Push pyads to 3.0.7 (home-assistant#21216)

* Push to pyads 3.0.7

* Correct too long line

* Bumped version to 0.88.0b4

* Fix the build (home-assistant#21229)

* Update pyhomematic to 0.1.56 (home-assistant#21227)

* Prevent invalid context from crashing (home-assistant#21231)

* Prevent invalid context from crashing

* Lint

* Add self to integration sensor and utility_meter (home-assistant#21226)

* Fix an Ambient PWS exception when location info is missing (home-assistant#21220)

* Add zone and reps for Xiaomi vacuum (home-assistant#19777)

* xiaomi vacuum with zone and reps

* tail whitespace

* tail whitespaces

* new version

* fix params typs

* fix param type

* line length

* rytilahti tips

* houndci-bot

* fix trevis

* rytilahti tips

* service description

* syssi fix

* MartinHjelmare tips

* MartinHjelmare

* data_template schema

* line lenght

* line lenght

* line lenght

* data_template schema

* fix

* Update homeassistant/components/vacuum/xiaomi_miio.py

Co-Authored-By: marcogazzola <dev@marcogazzola.com>

* Update homeassistant/components/vacuum/xiaomi_miio.py

Co-Authored-By: marcogazzola <dev@marcogazzola.com>

* xiaomi vacuum with zone and reps

* tail whitespace

* new version

* fix param type

* rytilahti tips

* rytilahti tips

* MartinHjelmare

* data_template schema

* line lenght

* line lenght

* data_template schema

* fix

* Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev

* Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev"

This reverts commit e1f370b.

* log fixed

* Revert "log fixed"

This reverts commit 1f0e7b3.

* Revert "Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev""

This reverts commit 1cf9e5a.

* Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev"

This reverts commit 0e8d534.

* log fixed

* Don't dispatch to components when there are no channels for ZHA sensors (home-assistant#21223)

* don't dispatch when channels don't exist

* review comment

* Fix bug in ZHA and tweak non sensor channel logic (home-assistant#21234)

* fix race condition and prevent profiles from stealing channels

* fix battery voltage

* Bump zigpy (home-assistant#21203)

* Bump zigpy

* Update requirements

* Update test requirements

* Bump zigpy-deconz

* Support OpenWRT 18.06 in luci device tracker (home-assistant#21236)

* Got it right this time i hope

* updates on comments

* Updated frontend to 20190220.0

* Updated frontend to 20190220.0

* Refactor ZHA listeners into channels (home-assistant#21196)

* refactor listeners to channels

* update coveragerc

* Fix an Ambient PWS exception when location info is missing (home-assistant#21220)

* Prevent invalid context from crashing (home-assistant#21231)

* Prevent invalid context from crashing

* Lint

* Bumped version to 0.88.0

* Don't dispatch to components when there are no channels for ZHA sensors (home-assistant#21223)

* don't dispatch when channels don't exist

* review comment

* Fix bug in ZHA and tweak non sensor channel logic (home-assistant#21234)

* fix race condition and prevent profiles from stealing channels

* fix battery voltage

* Remove constraint from regex (home-assistant#21239)

* Upgrade opensensemap-api to 0.1.4 (home-assistant#21240)

* Alarm trigger support for Point (home-assistant#21207)

* Prevent partial custom component overlays (home-assistant#21070)

* Prevent partial custom component overlays

* Fix tests

* Fix ZHA bugs (home-assistant#21246)

* fix bugs

* add comment

* allow entities to be marked unavailable

* Correctly detect devices, which went offline during HA restart (home-assistant#20933)

* Correctly detect devices, which went offline during HA restart

* Update __init__.py

* Update rova component with suffix for house number (home-assistant#21182)

* Update rova component with release rova release 0.1.0
Add house_number_suffix to configuration

* Set default value for house_number_suffix

* Add missing configuration option to plex (home-assistant#21264)

Fixes part of: home-assistant#21254

* Add missing configation option (home-assistant#21265)

Fixes home-assistant#21254

* Add SamsungTV Mac validation (home-assistant#21268)

* Added device tracker support for Ubee Router (home-assistant#19586)

* Added Ubee Router Device Tracker.

* Updated code to meet requirements.

* Code clean-up.

* Code clean-up.

* Code clean-up.

* Minor error message update

* Ubee device tracker: Minor code clean-up

* Bump pyubee version

* Code clean-up

* account specific cookies file to enable multiple accounts (home-assistant#19811)

* Add support for automatic discovery of TP-Link switches, bulbs and dimmers (home-assistant#18091)

* {switch,light}.tplink: use deviceid as unique id, fetch name from the device during initialization

* raise PlatformNotReady when no device is available

* Use mac instead of deviceid

* remove name option as obsolete

* Add support for configuration flow / integration

Allows activating automatic discovery of supported devices from the configuration

* Fix linting, update requirements_all.txt

* start cleaning up tplink component based on feedback

* add device info, improve config handling

* Allow overriding detected devices via configuration file

* Update requirements.txt

* Remove debug logging

* make hound happy

* Avoid I/O during init and simplify the code, remove remains of leds_on

* Fix issues based on feedback, use consistent quotation marks for device info

* add async_setup_platform emiting a deprecation warning

* Avoid blocking the I/O, check for None on features

* handle some Martin's comments, schema-validation is still missing

* use async_create_task instead of async_add_job, let core validate the schema

* simplify configuration handling by storing the configuration data separately from initialized instances

* add default values to schema, make hound happy

* with defaults set by schema, simplify the checks. add async_unload_entry

* Use constant for data structure access

* REWORD add a short note about async_unload_entry

* handle feedback from Martin, config_data is checked against Noneness

* use pop to remove the domain on unload

* First steps to add tests for the new tplink component

* embed platforms under the component directory

* Fix tests by mocking the pyhs100 internals

* Fix linting

* Test against multiple instances of devices, tidy up

* (hopefully) final linting round

* Add pyHS100 to test requirements

* log always the warnings occured during an update to make them easy to see

* revert back the warning behavior (requirement for silver level in IQS)

* Unload only when an entry is being loaded and add tests for that

Thanks @MartinHjelmare for pointing this out!

* Fix linting

* Bump the upstream lib, fixes most prominently the HSV setting on bulbs

* Test unloading for all platforms, clear the data storage instead of popping it out, making it possible to reconfigure after removal without restarting hass first

* Use class variables instead of instance variables for bulb states, required for HS220

* Use new-style format string

* Fix indenting, uppercase the mock constant

* Run black on test_init, hopefully that will finally fix the weird formatting (pycharm, pylint and hound seems to have different opinions...)

* update services.yaml (home-assistant#21276)

* Fix unhandled exception in Ambient PWS config entry (home-assistant#21278)

* Version bump: python-anthemav to v1.1.9 (home-assistant#21273)

* Do not warn for internally loaded components (home-assistant#21287)

* Fix yeelight config validation (home-assistant#21295)

* Update translations

* Remove index (home-assistant#21304)

* Remove index

* Remove emnumerate
@speedmann

This comment has been minimized.

Copy link
Contributor

speedmann commented Mar 3, 2019

This might not be the place to ask this, but why the heck do you guys need to break stuff regulary? We had a nice easy way to use the tp link switches INCLUDING out of the box power readings. With this, i have to fiddle around with stupid template sensors and stuff which is a pain in the ...

Sorry, but i am really angry about this right now, as this happenes almost every release. Last time ZHA was broken completely and is useless, this time it will be the tplink switches. Whats next?
My current installation is not able to turn the lights on or turn any switches on. This basically makes hass obsolet as i have to do everything manually again.

rambling over

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Mar 3, 2019

@balloob

This comment has been minimized.

Copy link
Member

balloob commented Mar 3, 2019

@speedmann Where is the thank you? How much did you pay exactly for this product? We are working on making Home Assistant more accessible to more users, easier to set up and easier to use. We will keep breaking all your stuff, again and again, until we get there.

If you don't have the technical knowledge to see how these changes are a big step up for this component and Home Assistant, don't comment. Definitely don't come here attacking us with some baseless accusations that make it sound like we break things for the sake of breaking things.

@rytilahti

This comment has been minimized.

Copy link
Contributor Author

rytilahti commented Mar 4, 2019

On top of that, this change should not have changed anything regarding to the power readings, so if that's the case a new issue should be opened for that. The only real breaking change this PR should have introduced is that the name of the device is not configurable via config file, but is read out from the device.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.