mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +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._balance: float = None
|
||||||
self._currency: str = 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:
|
def update(self) -> None:
|
||||||
"""Get the current balance and currency for the account."""
|
"""Get the current balance and currency for the account."""
|
||||||
bank = self._client.client
|
bank = self._client.client
|
||||||
@ -229,14 +221,6 @@ class FinTsHoldingsAccount(Entity):
|
|||||||
self._holdings = []
|
self._holdings = []
|
||||||
self._total: float = None
|
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:
|
def update(self) -> None:
|
||||||
"""Get the current holdings for the account."""
|
"""Get the current holdings for the account."""
|
||||||
bank = self._client.client
|
bank = self._client.client
|
||||||
|
@ -174,11 +174,6 @@ class HistoryStatsSensor(Entity):
|
|||||||
"""Return the unit the value is expressed in."""
|
"""Return the unit the value is expressed in."""
|
||||||
return self._unit_of_measurement
|
return self._unit_of_measurement
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Return the polling state."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes of the sensor."""
|
"""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 the unit of measurement of this entity, if any."""
|
||||||
return self._unit_of_measurement
|
return self._unit_of_measurement
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Return the polling state."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Get the latest data from Influxdb and updates the states."""
|
"""Get the latest data from Influxdb and updates the states."""
|
||||||
self.data.update()
|
self.data.update()
|
||||||
|
@ -77,11 +77,6 @@ class SkybellDevice(Entity):
|
|||||||
"""Initialize a sensor for Skybell device."""
|
"""Initialize a sensor for Skybell device."""
|
||||||
self._device = device
|
self._device = device
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Return the polling state."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update automation state."""
|
"""Update automation state."""
|
||||||
self._device.refresh()
|
self._device.refresh()
|
||||||
|
@ -72,11 +72,6 @@ class TwitchSensor(Entity):
|
|||||||
self._follow = None
|
self._follow = None
|
||||||
self._statistics = None
|
self._statistics = None
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Device should be polled."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the sensor."""
|
"""Return the name of the sensor."""
|
||||||
|
@ -227,11 +227,6 @@ class WirelessTagBaseSensor(Entity):
|
|||||||
self._name = self._tag.name
|
self._name = self._tag.name
|
||||||
self._state = None
|
self._state = None
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Return the polling state."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the sensor."""
|
"""Return the name of the sensor."""
|
||||||
|
@ -174,11 +174,6 @@ class XiaomiAirQualityMonitor(Entity):
|
|||||||
ATTR_MODEL: self._model,
|
ATTR_MODEL: self._model,
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Poll the miio device."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
"""Return an unique ID."""
|
"""Return an unique ID."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user