home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.82k forks source link

TP Link Switch no longer reading switch name from switch #11706

Closed joe248 closed 6 years ago

joe248 commented 6 years ago

Home Assistant release (hass --version): 0.61.0

Python release (python3 --version): Python 3.5.3

Component/platform: TP Link Switch

Description of problem: I have a TP Link HS100 switch that I named "Bedroom Fan" with the Kasa app. Home Assistant correctly named the switch as "Bedroom Fan" prior to 0.61.0. After upgrading to 0.61, the switch is now named "TP-Link Switch". I believe this was broken by #11346. I think that adding the default name here is preventing pulling the name from the switch itself here.

Expected: Home Assistant is able to get the switch name from the switch itself without having to do anything extra in the config.

Problem-relevant configuration.yaml entries and steps to reproduce:

switch:
  - platform: tplink
    host: xxx.xxx.xxx.xxx
DanNixon commented 6 years ago

Ah. My bad.

I'll have a fix (~and some unit tests~) coming soon.

EDIT: I'm struggling to find a nice way to mock the psHS100 library.

joe248 commented 6 years ago

Thanks!