djbulsink / panasonic_ac

Panasonic Comfort Cloud HA component
30 stars 16 forks source link

Makes component discoverable #5

Closed SeraphimSerapis closed 5 years ago

SeraphimSerapis commented 5 years ago

Description: While validating my Home Assistant configuration, I noticed that the custom component was not discoverable. This threw an error and causes the configuration validation (hass --script check_config) to fail: Platform not found: climate.panasonic_ac.

What I changed: It seems like add_entities(ENTITY, True) should be used instead of add_devices(ENTITY). As far as I understand, the boolean value announces the component to Home Assistant.

In addition to that, I did some refactoring to comply with the changes in 0.92.

SeraphimSerapis commented 5 years ago

I had to do some extra work in c7f4cb1 to address an error that appeared when importing constants. Tested and works for me!

djbulsink commented 5 years ago

Hi @SeraphimSerapis ,

Thanks for this contribute. Looks good. I'll merge it.

Regard, DJ