* Handle dhcp packets without a hostname
- Since some integrations only match on OUI we want to
make sure they still see devices that do not request
a specific hostname
* Update tests/components/dhcp/test_init.py
* Update homeassistant/components/dhcp/__init__.py
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Franck Nijhof <git@frenck.dev>
Some routers will lowercase all the hostnames. Since we
already lowercase hostnames for matching purposes, we now
pass the lowercased hostname to the integration.
Currently only roomba cared about this, and has been adjusted.
* Fix memory leak in dhcp integration
Passing the L2socket to AsyncSniffer caused a memory
leak on some systems. To ensure we can create a socket,
we do a test creation before starting AsyncSniffer
since the sniffer will create it in another thread
and we cannot see any permission error otherwise.
* Update tests
* space
* do not store packets
* Discover devices from device_trackers with router sources
* Update homeassistant/components/dhcp/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* fix stop being called on the wrong context
* clean
* move it to base
* cleanup was too agressive
* Update homeassistant/components/dhcp/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* coverage
* revert legacy changes
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>