Commit Graph

16 Commits (9daf2ee65d617055b7b17783a369e4b5f5fe4006)

Author SHA1 Message Date
J. Nick Koston b86e19143d
Prevent event loop delay / instability from discovery (#57463) 2021-10-13 08:37:14 -07:00
J. Nick Koston 2ed35debdc
Fix dhcp discovery matching due to deferred imports (#56814) 2021-09-29 23:50:21 -05:00
Erik Montnemery dd7dea9a3f
Make scapy imports in DHCP local (#55647) 2021-09-06 10:10:27 -07:00
J. Nick Koston 6a5dcf0869
Handle dhcp packets without a hostname (#52882)
* 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>
2021-07-12 17:25:16 +02:00
Ville Skyttä 153d6e891e
Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
J. Nick Koston f91de1c8b9
Add support for capturing renewals to dhcp discovery (#48242) 2021-03-30 15:41:12 +02:00
J. Nick Koston 2ff94c8ed9
Add additional data source to dhcp (#48430) 2021-03-28 09:47:28 -10:00
J. Nick Koston 958c4764f7
Handle routers that convert hostnames to lowercase in dhcp (#48429)
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.
2021-03-28 11:23:06 +02:00
J. Nick Koston 1dd35ff059
Catch dhcp setup permission errors sooner (#47639)
This solves an unexpected thread exception on macs when running as
a user intead of root
2021-03-08 15:15:22 -08:00
J. Nick Koston 01e73911d6
Do not listen for dhcp packets if the filter cannot be setup (#46006) 2021-02-05 00:36:55 +01:00
J. Nick Koston e8cda598ac
Fix memory leak in dhcp integration (#45378)
* 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
2021-01-21 08:26:58 +01:00
J. Nick Koston 3ae527c158
Switch dhcp to use async sniff for faster shutdown (#45339)
* Switch dhcp to use async sniff for faster shutdown

* Do not actually start the thread since we do not know when it will finish starting
2021-01-19 20:49:49 +01:00
J. Nick Koston fbc98b1291
Make DHCP discovery ignore self assigned ip addresses (#45256) 2021-01-17 10:35:02 +01:00
J. Nick Koston 5e01b828af
Discover devices from device_trackers with router sources (#45160)
* 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>
2021-01-16 01:01:37 +01:00
J. Nick Koston 7fada806af
Downgrade dhcp log message error message when running without CAP_NET_RAW (#45157) 2021-01-14 10:46:15 -10:00
J. Nick Koston da677f7d5a
Add support for discovery via DHCP (#45087)
* Add support for discovery via DHCP

* additional tesla ouis

* merge tests

* dhcp test

* merge requirements test

* dhcp test

* dhcp discovery

* dhcp discovery

* pylint

* pylint

* pylint

* fix

* Add matching tests

* 100% cover

* cleanup

* fix codespell

* Update exception handling

* remove unneeded comment

* fix options handling exception

* fix options handling exception
2021-01-14 09:09:08 +01:00