Do not call update() in constructor (#8878)
* Do not call update() in constructor * Fix lint issues
This commit is contained in:
parent
588b36dff2
commit
f513f6271e
35 changed files with 142 additions and 177 deletions
|
@ -65,7 +65,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
for variable in config[CONF_DISPLAY_OPTIONS]:
|
||||
dev.append(SenseHatSensor(data, variable))
|
||||
|
||||
add_devices(dev)
|
||||
add_devices(dev, True)
|
||||
|
||||
|
||||
class SenseHatSensor(Entity):
|
||||
|
@ -78,7 +78,6 @@ class SenseHatSensor(Entity):
|
|||
self._unit_of_measurement = SENSOR_TYPES[sensor_types][1]
|
||||
self.type = sensor_types
|
||||
self._state = None
|
||||
self.update()
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue