-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device tracker component & platform validation. No more home_range. #2908
Conversation
if hasattr(platform, 'PLATFORM_SCHEMA'): | ||
p_config = platform.PLATFORM_SCHEMA(p_config) | ||
except vol.MultipleInvalid as ex: | ||
_log_exception(ex, DOMAIN, p_config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this function to remove the _
prefix. The convention is Python that _
prefix means that it's private to that module and should not be used.
Your commits seem weird for this PR? It includes secrets , vsure bump |
I forced the "Mock, bluetooth" commit and it seemed to have caused issues. Will separate tomorrow |
Bump :) |
|
conf = conf[0] if len(conf) > 0 else {} | ||
def _component_value(key_name, default): | ||
"""Retrieve a config value & ensure all platforms agree.""" | ||
res = list(set([plat[key_name] for plat in conf if key_name in plat])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't like this. Why even bother checking the other platforms ?
@kellerza What's the status on this? Good to merge? |
@robbiet480 Let me just add a test for the duplicate MAC / dev_id detection to at least keep coverage the same |
Hey @kellerza, got an update on this? Looks like tests just need to be fixed then it's good to go? |
Seems like |
@robbiet480 should be ok now. Coverage up 0.4% |
device_tracker.Device(self.hass, True, True, 'your_device', | ||
'AB:01', 'Your device', None, None, False)] | ||
device_tracker.DeviceTracker(self.hass, False, True, devices) | ||
print(mock_warning.call_args_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By design, or should I rather add it to the assert string below?
🐬 |
Description:
*Device tracker component & validation for platforms
*Removed home_range from device_tracker
Example entry for
configuration.yaml
(if applicable):device_tracker:
If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass