Explain why should_pool is True initially for wemo (#47191)

pull/47189/head^2
Eric Severance 2021-02-28 15:51:43 -08:00 committed by GitHub
parent c6223873f4
commit 1d7660f071
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -142,8 +142,15 @@ class WemoSubscriptionEntity(WemoEntity):
def should_poll(self) -> bool:
"""Return True if the the device requires local polling, False otherwise.
It is desirable to allow devices to enter periods of polling when the
callback subscription (device push) is not working. To work with the
entity platform polling logic, this entity needs to report True for
should_poll initially. That is required to cause the entity platform
logic to start the polling task (see the discussion in #47182).
Polling can be disabled if three conditions are met:
1. The device has polled to get the initial state (self._has_polled).
1. The device has polled to get the initial state (self._has_polled) and
to satisfy the entity platform constraint mentioned above.
2. The polling was successful and the device is in a healthy state
(self.available).
3. The pywemo subscription registry reports that there is an active