giachello / mlgw

This components integrates Bang & Olufsen Master Link Gateway and Beolink Gateway to Home Assistant, the open-source home automation platform.
28 stars 6 forks source link

Add unique_id and DeviceInfo #11

Closed astrandb closed 2 years ago

astrandb commented 2 years ago

Thanks for a great component. I have just started to play with it and it looks very promising towards my needs. I have added a few lines that will enable better integration with other features in Home Assistant.

giachello commented 2 years ago

Thank you for the additional code!

Can you please make the unique id more unique by adding the serial number of the mlgw in addition to the mln. If people have 2 mlgw, then two devices may have the same mln.

Also maybe add a string like mlgw instead of "mediaplayer"

astrandb commented 2 years ago

Good idea with serial number. I'll add it. The unique_id only needs to be unique within each domain so it is not meaningful to add "mlgw". I added mediaplayer to be future proof if other platforms (switch, sensor, binary_sensor) with same "mln" are added in the future.

astrandb commented 2 years ago

My main personal interest in this integration is to use B&O remotes to generate events in HA. It seems to work fine. I use the HA development container and it spits out quite a lot of comments regarding breaches of HA coding standards. This has no functional implications (perhaps some performance implications) and can easily be corrected but I have left that to a later PR if you find it appropriate.

astrandb commented 2 years ago

Adding a device for the gateway also. The name of the mother gateway is displayed in each media player device info page.