8000 [Python] Only auto re-subscribe after initial subscription by agners · Pull Request #34370 · project-chip/connectedhomeip · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Python] Only auto re-subscribe after initial subscription #34370

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/controller/python/chip/clusters/attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,20 @@ class ReadClientCallback : public ReadClient::Callback

void OnSubscriptionEstablished(SubscriptionId aSubscriptionId) override
{
// Only enable auto resubscribe if the subscription is established successfully.
mAutoResubscribeNeeded = mAutoResubscribe;
gOnSubscriptionEstablishedCallback(mAppContext, aSubscriptionId);
}

CHIP_ERROR OnResubscriptionNeeded(ReadClient * apReadClient, CHIP_ERROR aTerminationCause) override
{
if (mAutoResubscribe)
if (mAutoResubscribeNeeded)
{
ReturnErrorOnFailure(ReadClient::Callback::OnResubscriptionNeeded(apReadClient, aTerminationCause));
}
gOnResubscriptionAttemptedCallback(mAppContext, ToPyChipError(aTerminationCause),
apReadClient->ComputeTimeTillNextSubscription());
if (mAutoResubscribe)
if (mAutoResubscribeNeeded)
{
return CHIP_NO_ERROR;
}
Expand Down Expand Up @@ -242,7 +244,8 @@ class ReadClientCallback : public ReadClient::Callback
PyObject * mAppContext;

std::unique_ptr<ReadClient> mReadClient;
bool mAutoResubscribe = true;
bool mAutoResubscribe = true;
bool mAutoResubscribeNeeded = false;
};

extern "C" {
Expand Down
Loading
0