Skip to content

Commit 0ce8a4f

Browse files
committed
code format
2 parents 107264c + d9d85b6 commit 0ce8a4f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

custom_components/keyatome/sensor.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,12 @@ def _compute_period_usage(self, values, nb_of_day, ref_day, period_type):
549549
(values["data"][-i]["consumption"]["bill1"]),
550550
ROUND_PRICE,
551551
)
552-
_LOGGER.debug("%s : DETAILED value %s: %s", period_type, i, values["data"][-i])
552+
_LOGGER.debug(
553+
"%s : DETAILED value %s: %s", period_type, i, values["data"][-i]
554+
)
553555
except:
554556
_LOGGER.debug("days %s does not exist ", -i)
555557

556-
557558
self._periods_data.all_period[period_type].usage = current_period_consumption
558559
self._periods_data.all_period[period_type].price = current_period_price
559560
self._periods_data.all_period[period_type].ref_day = ref_day
@@ -1026,8 +1027,10 @@ def update_from_latest_data(self):
10261027
self._last_valid_period_data.usage,
10271028
)
10281029
# Take a margin to avoid storage of previous data
1029-
diff_period_day = new_period_data.ref_day - self._last_valid_period_data.ref_day
1030-
if diff_period_day > timedelta(seconds=1) :
1030+
diff_period_day = (
1031+
new_period_data.ref_day - self._last_valid_period_data.ref_day
1032+
)
1033+
if diff_period_day > timedelta(seconds=1):
10311034
_LOGGER.debug(
10321035
"Previous period %s becomes %s",
10331036
self._name,

0 commit comments

Comments
 (0)