mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Remove unnecessary should poll from sensor classes (#41219)
* Remove unnecessary should poll from sensor classes * Remove two more occurrences
This commit is contained in:
parent
e51be33e18
commit
f47d58d9c2
@ -169,14 +169,6 @@ class FinTsAccount(Entity):
|
||||
self._balance: float = None
|
||||
self._currency: str = None
|
||||
|
||||
@property
|
||||
def should_poll(self) -> bool:
|
||||
"""Return True.
|
||||
|
||||
Data needs to be polled from the bank servers.
|
||||
"""
|
||||
return True
|
||||
|
||||
def update(self) -> None:
|
||||
"""Get the current balance and currency for the account."""
|
||||
bank = self._client.client
|
||||
@ -229,14 +221,6 @@ class FinTsHoldingsAccount(Entity):
|
||||
self._holdings = []
|
||||
self._total: float = None
|
||||
|
||||
@property
|
||||
def should_poll(self) -> bool:
|
||||
"""Return True.
|
||||
|
||||
Data needs to be polled from the bank servers.
|
||||
"""
|
||||
return True
|
||||
|
||||
def update(self) -> None:
|
||||
"""Get the current holdings for the account."""
|
||||
bank = self._client.client
|
||||
|
@ -174,11 +174,6 @@ class HistoryStatsSensor(Entity):
|
||||
"""Return the unit the value is expressed in."""
|
||||
return self._unit_of_measurement
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""Return the polling state."""
|
||||
return True
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
|
@ -224,11 +224,6 @@ class InfluxSensor(Entity):
|
||||
"""Return the unit of measurement of this entity, if any."""
|
||||
return self._unit_of_measurement
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""Return the polling state."""
|
||||
return True
|
||||
|
||||
def update(self):
|
||||
"""Get the latest data from Influxdb and updates the states."""
|
||||
self.data.update()
|
||||
|
@ -77,11 +77,6 @@ class SkybellDevice(Entity):
|
||||
"""Initialize a sensor for Skybell device."""
|
||||
self._device = device
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""Return the polling state."""
|
||||
return True
|
||||
|
||||
def update(self):
|
||||
"""Update automation state."""
|
||||
self._device.refresh()
|
||||
|
@ -72,11 +72,6 @@ class TwitchSensor(Entity):
|
||||
self._follow = None
|
||||
self._statistics = None
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""Device should be polled."""
|
||||
return True
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the sensor."""
|
||||
|
@ -227,11 +227,6 @@ class WirelessTagBaseSensor(Entity):
|
||||
self._name = self._tag.name
|
||||
self._state = None
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""Return the polling state."""
|
||||
return True
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the sensor."""
|
||||
|
@ -174,11 +174,6 @@ class XiaomiAirQualityMonitor(Entity):
|
||||
ATTR_MODEL: self._model,
|
||||
}
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""Poll the miio device."""
|
||||
return True
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Return an unique ID."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user