Make Vera should_poll static rather than dynamic (#47854)

* Make should_poll static.

* Address review comments.

* Fix black error.
pull/48133/head
Greg Dowling 2021-03-19 19:27:56 +00:00 committed by GitHub
parent 24e067782a
commit b03c97cdd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -510,7 +510,7 @@ homeassistant/components/usgs_earthquakes_feed/* @exxamalte
homeassistant/components/utility_meter/* @dgomes
homeassistant/components/velbus/* @Cereal2nd @brefra
homeassistant/components/velux/* @Julius2342
homeassistant/components/vera/* @vangorra
homeassistant/components/vera/* @pavoni
homeassistant/components/verisure/* @frenck
homeassistant/components/versasense/* @flamm3blemuff1n
homeassistant/components/version/* @fabaff @ludeeus

View File

@ -236,7 +236,9 @@ class VeraDevice(Generic[DeviceType], Entity):
def update(self):
"""Force a refresh from the device if the device is unavailable."""
if not self.available:
refresh_needed = self.vera_device.should_poll or not self.available
_LOGGER.debug("%s: update called (refresh=%s)", self._name, refresh_needed)
if refresh_needed:
self.vera_device.refresh()
@property

View File

@ -4,5 +4,5 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/vera",
"requirements": ["pyvera==0.3.13"],
"codeowners": ["@vangorra"]
"codeowners": ["@pavoni"]
}