Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically discover mac address of bridge + HACS improvements #55

Closed
wants to merge 17 commits into from
Closed

Dynamically discover mac address of bridge + HACS improvements #55

wants to merge 17 commits into from

Conversation

rsnodgrass
Copy link
Contributor

  • dynamically discover mac address of bridge (config does not need to be specified for entity registry to work)
  • rename README.md to be HACS compatible as default README
  • adds hacs.json for improved HACS support (default readme)

@sreknob
Copy link

sreknob commented May 22, 2020

according to #56 & #57 there may be issues with HA <110
maybe also specify a minimum version in hacs.json to prevent people breaking their current installations if they don't want to upgrade yet....

{
  "name": "Lutron Caseta Smart Bridge PRO / RA2 Select",
  "domains": [ "cover", "fan", "light", "scene", "sensor", "switch" ],
  "homeassistant": "0.110",
  "render_readme": true
}

@rsnodgrass
Copy link
Contributor Author

according to #56 & #57 there may be issues with HA <110
maybe also specify a minimum version in hacs.json to prevent people breaking their current installations if they don't want to upgrade yet....

Good point about minimum version for the updated version. I have updated this to include that limitation (now that we have a hacs.json file).

@rsnodgrass
Copy link
Contributor Author

@upsert can you look at this change, it now restricts updates to 0.110 (with thew new hacs.json file) and automatically discovers the MAC address of the bridge.

Copy link
Owner

@upsert upsert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The info.md was provided for rendering in HACS. It should not need the readme rendered as it is very long.

@rsnodgrass
Copy link
Contributor Author

@upsert Aha, thanks for catching that. I have removed render_readme and did an editing pass on the info.md file.

@upsert
Copy link
Owner

upsert commented May 23, 2020

I've done some testing and I'm seeing that get_mac_address returns 00:00:00:00:00:00 the first time you run it when the ARP cache is empty. It causes the devices to be setup using 00:00:00:00:00:00 as the unique ID and then if you restart Home Assistant, it successfully gets the MAC from the warm cache and sets them up under their proper unique ID. It results in duplicates of all the devices.

It is not clear if this is an issue with the getmac library or there is something else that needs to be done to get it to work. I tried adding network_request=True and it did not seem to make a difference.

Tested on a virtual machine running Ubuntu 18.04.04 LTS.

@upsert
Copy link
Owner

upsert commented May 26, 2020

I've integrated your changes to info.md, README.md and the HACS file. The JSON should help head off issues being raised due to the recent breaking changes and the requirement for 0.110.

@rsnodgrass
Copy link
Contributor Author

rsnodgrass commented May 26, 2020 via email

mac_address = None
# load the bridge's MAC address used for generating unique IDs for each device
host = bridge[CONF_HOST]
mac_address = getmac.get_mac_address(ip=host)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does I/O and can also throw an exception. It should be wrapped in await hass.async_add_executor_job. ... probably will need partial as well due to the keyword arg.

@upsert
Copy link
Owner

upsert commented Feb 5, 2022

At this point, this custom component is in maintenance mode and will not be adding new features or dependencies. See the built-in integration for Lutron Caséta for more features including auto-discovery.

@upsert upsert closed this Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants