elad-bar / ha-edgeos

Integration with EdgeOS (Ubiquiti)
134 stars 23 forks source link

Make unknown_devices.attributes.leased a dict #157

Open illuzn opened 1 month ago

illuzn commented 1 month ago

This makes each item in unknown_devices.attributes.leased a dict (i.e. a dict of dicts).

For example

leased:
  192.168.1.2:
    mac: aa:bb:cc:dd:ee:ff
    hostname: abcdef
  192.168.1.3:
    mac: 11:22:33:44:55:66
    hostname: 123456

This makes processing this attribute far easier in Home Assistant for example in my unknown devices blueprint which generates a notification when an unknown device connects.

Technically, this is a breaking change but it the behaviour was broken by an undocumented change during the refactor anyway - from 192.168.1.2: aa:bb:cc:dd:ee:ff (?) to 192.168.1.2: aa:bb:cc:dd:ee:ff