Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 very long and will also delay startup of Home Assistant if the device is offline (because it is blocking during setup). Can you detect if it’s an NVR and if so, make it 30s ? Also what can take up to 30 seconds to reply, that sounds like some other issue
Uh oh!
There was an error while loading. Please reload this page.
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.
the main problem is, that the
surveillance_station.updatein the library does multiple API calls sequentially - first gather all cameras, next iterate over each camera and gather the motion detection state.In case of #58793 the "gather all cameras" lasts already 2s which returns 7 cameras ... each "gather motion detection state" lasts ~1-1.5s, those the 7th iteration was already causing the timeout - honestly the used NAS (model DS214) is not quiet powerful, but also actual models rely often on efficient small ARM cpu's.
Maybe we can limit the timeout to 20s to be more friendly to the entrance class NAS - sure, the overall solution should be to divide the data gathering into own update coordinators per each camera, but this needs also a rework of the library (already on my todo list for the upcoming winter months)
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.
btw if the NAS is not online during setup a
ConfigEntryNotReadyis raisedcore/homeassistant/components/synology_dsm/__init__.py
Line 135 in 80f1e87
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'm fine with accepting this now to relief some pressure for this release, but this is not the right fix. Instead of a global timeout it should have a timeout per request.