* Wemo Dimmer Support
Add support for the Wemo Dimmer Switch
* Add newline at end of file
Re: findings from hound
* Syntax for the hound
Sorry for the excess edits, new to python
* Change order of Models
Fixed order back to ABC order
* Changes as requested
I made the changes I was comfortable with at this point, the dimmer addition now very closely mirrors what is under the switch component, at least as far as the parts necessary for the dimmer.
Any changes past these with regards to the subscription registry / callback info is probably going to be over my head, but I will try to look deeper at them if required.
* Remove unnecessary lines
Removed self.schedule_update_ha_state() from turn off / turn on
* Remove update(self)
Removed update method
* Move subscription to async_added_to_hass
* Move subscription.
* Clean up.
* Wait until the job in the executor is done
* Run gen_requirements_all script
* Only update instance attributes via callback
This makes us track WeMo devices by serial number instead of URL. Per
@jaharkes' suggestion, tracking via URL could potentially be a problem
if a device changes to another IP and then appears to be discovered again.
Since we can't track based on mac (for static-configured devices), we
can use the serial number exposed to make sure we're always looking at
a list of unique devices.
I broke this with my fix, where I assumed that we'd always have a wemo
config section if we're running the wemo code. However, if we're fully
auto-detected, we might not.
The wemo component was tracking devices by mac to avoid adding duplicates,
but this means we'd never be able to load more than one static wemo, since
they all have mac=None.
This changes the code to track by url, which has to be unique per wemo
anyway, and which we also have for even static wemos.
I only have WeMo Link and Insight devices and assumed model names of other
devices were fairly straightforward.
But it looks like the regular WeMo switch uses 'Socket' as the model name.
A major change to the bootstrapping of Home Assistant decoupling the
knowledge in bootstrap for a more dynamic approach. This refactoring
also prepares the code for different configuration backends and the
loading components from different places.