-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
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
Add sw_version
to GPSd
#137328
base: dev
Are you sure you want to change the base?
Add sw_version
to GPSd
#137328
Conversation
Hey there @fabaff, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
||
def fetch_data() -> None: | ||
while agps_thread.data_stream.release == "n/a": | ||
sleep(0.2) |
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.
Ideally we don't use time.sleep
as that freezes the whole of HA. Rather use asyncio.sleep
.
But why do we need to sleep in the first place?
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 integration subscribes to a stream of gpsd, and we need to wait until the version data is available, this could take some time so we cannot set DeviceInfo before that information is available. Your comment about asyncio.sleep
sounds reasonable.
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.
But do we get the software version at some point in the future? Because if that is the case I would almost say, just create a task you call after one minute or so (when you know you would have received the data) and then update the device, rather than waiting until we got it, because the integration can still work without it
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Add
sw_version
to GPSdType 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: