notoriousbdg / Home-AssistantConfig

Apache License 2.0
180 stars 49 forks source link

Devices with battery_alert_disabled set are not filtered out #6

Closed Djebouh closed 5 years ago

Djebouh commented 5 years ago

First, thanks for the package, very well done and useful.

My ios phones defined are coming with a "sensor.xxxxx_battery_level" sensor which is well detected by "automation.update_battery_status_group_members". On the other hand, I want to filter them out and they are not.

I think this is because the following condition " not is_state_attr(entity_id, 'battery_alert_disabled', true)" should apply to any item and not only to the ones with battery in their name. Indeed ios phones objects have a battery icon and are therefore matching the condition "or 'battery' in item.attributes.icon | lower"

I aso think " not is_state_attr(entity_id, 'battery_alert_disabled', true)" should in fact test item.entity_id.

notoriousbdg commented 5 years ago

You shouldn't get alerts for them if you're using battery_alert_disabled, but they'll be in the group. Are you looking for a way to exclude them from the group too?

A fix to the item.entity_id issue was merged last night.

Djebouh commented 5 years ago

I indeed thought only devices being monitored should be in the group.