mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 20:40:18 +00:00
Do not call update() in constructor (#7912)
* Do not call update() in constructor * Do not call update() in constructor * Remove unused import
This commit is contained in:
@@ -60,7 +60,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
_LOGGER.error("No battery found")
|
||||
return False
|
||||
|
||||
add_devices([LinuxBatterySensor(name, battery_id)])
|
||||
add_devices([LinuxBatterySensor(name, battery_id)], True)
|
||||
|
||||
|
||||
class LinuxBatterySensor(Entity):
|
||||
@@ -75,7 +75,6 @@ class LinuxBatterySensor(Entity):
|
||||
self._battery_stat = None
|
||||
self._battery_id = battery_id - 1
|
||||
self._unit_of_measurement = '%'
|
||||
self.update()
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
||||
Reference in New Issue
Block a user