Hi !
Can someone help me figuring out how DHCP discovery works?
On my dev environment it doesn’t seem to work. Its a macOS venv installation and I get [homeassistant.components.dhcp] Cannot watch for dhcp packets without root or CAP_NET_RAW: Can't attach the BPF filter !
when I start HA.
I’ve tried it on a Windows machine running WSL too - with the same error.
I’ve even tried to run a Dev-Container, but I don’t quite know what I’m doing there and it seems it doesn’t get any DHCP requests forwarded.
How can I test this?
About the implementation: I've added the OUI to the manifest and ran `script.hassfest` so it is added to generated/dhcp and added `async def async_step_dhcp()` to my config_flow.py.
async def async_step_dhcp(self, discovery_info: DhcpServiceInfo) -> FlowResult:
"""Handle a flow initiated by the DHCP client."""
discovery_input = {CONF_HOST: discovery_info.ip}
self._async_abort_entries_match(discovery_input)
return await self.async_step_user(user_input=discovery_input)
Can I just use DhcpServiceInfo data and forward it to self.async_step_user()
- this would create the config_entry - or do I need to add some kind of confirmation step (I’ve seen this on couple of integrations code)?
Regards, Farmio