Don't use len(SEQUENCE) as condition value (#7249)
* Don't use len(SEQUENCE) as condition value * Update volvooncall.py
This commit is contained in:
1 parent
15b2473224
commit
cfc023e128
43 files changed
+319
-355
No files matched your search
@@ -168,15 +168,15 @@ class InfluxSensorData(object):
|
||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||
def update(self):
|
||||
"""Get the latest data with a shell command."""
|
||||
_LOGGER.info('Running query: %s', self.query)
|
||||
_LOGGER.info("Running query: %s", self.query)
|
||||
|
||||
points = list(self.influx.query(self.query).get_points())
|
||||
if len(points) == 0:
|
||||
_LOGGER.warning('Query returned no points, sensor state set'
|
||||
' to UNKNOWN : %s', self.query)
|
||||
if not points:
|
||||
_LOGGER.warning("Query returned no points, sensor state set"
|
||||
" to UNKNOWN : %s", self.query)
|
||||
self.value = None
|
||||
else:
|
||||
if len(points) > 1:
|
||||
_LOGGER.warning('Query returned multiple points, only first'
|
||||
' one shown : %s', self.query)
|
||||
if points:
|
||||
_LOGGER.warning("Query returned multiple points, only first"
|
||||
" one shown : %s", self.query)
|
||||
self.value = points[0].get('value')
|
||||
Reference in new issue
Block a user