Restore for device_tracker#6150
Conversation
There was a problem hiding this comment.
Probably want a longitude here :)
There was a problem hiding this comment.
Indeed, thanks :-)
I still need to do tests that is why I marked it wip. Would prefer to have a helper from input_select
|
Well, I was just about to start looking at this. Glad I happened to look at PRs first! It looks reasonable to me. I think it goes without saying it would be nice if we could use EntityComponent within device tracker to eliminate some of the duplication, but I'm guessing that wasn't done because the differences are too great. |
|
Migrating this to EntityComponent could open up a whole new can of worms, so lets rather keep for another PR: One of the unnecessary things would be scan_interval that I could think of. Here we also use "see" and only one class of device. For now the async_added_to_hass is the only duplication introduced here, so should be ok |
|
Another problem with the EntityComponent is that DeviceTracker supports two types of platforms. The router ones that just provide a "get_devices" method and the ones that just call "see" |
There was a problem hiding this comment.
it should be state.attributes, not state.attr (I fixed this in your original PR too 🕺 )
There was a problem hiding this comment.
Thanks, I wasn't too sure :-)
Will still add tests and remove the WIP tag
There was a problem hiding this comment.
You can merge this when tests have been added. 🐬
There was a problem hiding this comment.
Heads up, I will be cutting the release branch tonight.
Description:
Add restore (#4614) to device_tracker.
Checklist:
If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass