netsoft-ruidias / ha-custom-component-coverflex

Coverflex - Custom Component for Home Assistant
MIT License
3 stars 5 forks source link

Add support to multiple pockets #4

Closed TiagoJVO closed 1 year ago

TiagoJVO commented 1 year ago

The "Pockets" API returns multiple pockets, and the previous version of this repo was indexing only the first one. As far as I can tell, it has a "benefits", a "meal" and a "main", but as it may be dynamic per card the change assumes any number of pockets.

So, I changed the initialization to load 1 sensor per "pocket", adding the "type" to the name of the sensor, and the id of the pocket to the unique_id.