chemaaa / homepluscontrol

Python-based API to interact with the Legrand Eliot Home + Control interface
GNU General Public License v3.0
17 stars 1 forks source link

Remove filtering of modules on the API's side. #10

Closed vlebourl closed 2 years ago

vlebourl commented 3 years ago

Filtering modules should be done per platform by the integration on HA's side. This will be done in switch.py and cover.py by something like this (in this case for covers):

new_entities = [
        HomeControlCoverEntity(coordinator, uid)
        for uid in new_unique_ids
        if coordinator.data[uid].device == "automation"
    ]
new_entities = [
        HomeControlCoverEntity(coordinator, uid)
        for uid in new_unique_ids
        if coordinator.data[uid].device in ["light", "plug"]
    ]
vlebourl commented 3 years ago

Sorry if I'm posting too much... I'm trying to make it good so I only have to modify the HA integration later, including adding energy meter as #5 is asking.

vlebourl commented 3 years ago

hey @chemaaa, any chance you might have a look at this?