PiotrMachowski / Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor

This custom integration provides a way to present a live view of a map for Xiaomi (Roborock/Viomi/Roidmi/Dreame) vacuums without a need for rooting.
MIT License
1.13k stars 122 forks source link

better filter on trigger event state_change #467

Closed marcob79 closed 11 months ago

marcob79 commented 11 months ago

adding in event_data the entity_id of input cavuum

PiotrMachowski commented 11 months ago

This event trigger can't be changed in this way - it is used in browser mode:

  is_browser_mod_template_trigger: |-
    {{
      mode_to_handle in ['browser_mod_path']
      and trigger.id == 'state_changed'
      and (
          trigger.event.data.new_state != None 
          and trigger.event.data.new_state.attributes != None 
          and "pathSegments" in trigger.event.data.new_state.attributes
          and browser_mod_path == trigger.event.data.new_state.state
        or
          trigger.event.data.old_state != None 
          and trigger.event.data.old_state.attributes != None 
          and "pathSegments" in trigger.event.data.old_state.attributes
          and browser_mod_path in trigger.event.data.old_state.state
        )
    }}