-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Update DeviceScanner to ScannerEntity in tomato #143102
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
base: dev
Are you sure you want to change the base?
Update DeviceScanner to ScannerEntity in tomato #143102
Conversation
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.
Pull Request Overview
This PR updates the Tomato component to replace the deprecated DeviceScanner with the new ScannerEntity.
- Updates the import statement to use ScannerEntity instead of DeviceScanner.
- Changes the class inheritance from DeviceScanner to ScannerEntity.
Comments suppressed due to low confidence (1)
homeassistant/components/tomato/device_tracker.py:52
- [nitpick] Consider reviewing the class name and its docstring to ensure they accurately reflect the updated inheritance and new ScannerEntity functionality.
class TomatoDeviceScanner(ScannerEntity):
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.
Pylint is failing, can you take a look?
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Pylint is checking the return type should be DeviceScanner. Should I update the checking to allow DeviceScanner? But it would change the checking on all components. |
@@ -428,7 +428,7 @@ class ClassTypeHintMatch: | |||
0: "HomeAssistant", | |||
1: "ConfigType", | |||
}, | |||
return_type=["DeviceScanner", None], | |||
return_type=["DeviceScanner", "ScannerEntity", None], |
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.
This is not correct. ScannerEntity
should only be used by integrations that support config entries. Refactor the tomato integration to use config entries when switching to use ScannerEntity
.
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.
That means rebuilding the integration to support config flow as well?
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.
Yes, that's right.
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Proposed change
SSIA.
Type of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: