Add AsusWRT Devices Connected Sensor#34204
Conversation
|
Hey there @kennedyshead, mind taking a look at this pull request as its been labeled with a integration ( |
|
I did try to add a unique_id, but couldn't find a good candidate. @kennedyshead since it's your library, do you know a way to get the router's mac address or serial number for example? This can always be a future change however |
| self._attributes = { | ||
| "mac_addresses": mac_addresses, | ||
| "ip_addresses": ip_addresses, | ||
| "hosts": hosts, |
There was a problem hiding this comment.
We try to avoid grouping values as attributes. Can we instead make one binary sensor per connected device with device class connectivity?
There was a problem hiding this comment.
Well we have device_tracker for that so I guess I'll remove the attributes
MartinHjelmare
left a comment
There was a problem hiding this comment.
Codeowner should approve too.
|
This just might be a bad idea... |
|
Nah! This will work fine for now. btw: Yes I'm 100% sure we can get a unique id for the router if we want to. |
|
In short: 🐬 |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Please extend the sensor tests to cover the diff. Ie set the "sensors" key in the config with "devices" when setting up the component with async_setup_component and patch the library appropriately.
MartinHjelmare
left a comment
There was a problem hiding this comment.
Please await hass.async_block_till_done() after setting up the component in the test and assert the state of the entities via the core state machine. We propably need to extend the mocking of the api methods to return appropriate data.
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
Proposed change
Adds a new sensor with the number of connected devices.
Type of change
Example entry for
configuration.yaml:Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.