@@ -2674,7 +2674,7 @@ def parse_veolia_historical_data(self, csv_file, website):
26742674 stat = {
26752675 "start" : date_formatted , # formatted date
26762676 "state" : int (row [2 ]),
2677- "sum" : int (row [1 ])
2677+ "sum" : int (row [1 ]),
26782678 }
26792679 # Add the stat to the array
26802680 stats_array .append (stat )
@@ -3124,8 +3124,8 @@ def update_veolia_historical_data(self, stats_array):
31243124 # Prepare the statistics that need to be sent for _period_total
31253125
31263126 total_stats = [
3127- {"start" : stat ["start" ], "state" : stat ["sum" ]}
3128- for stat in stats_array
3127+ {"start" : stat ["start" ], "state" : stat ["sum" ]}
3128+ for stat in stats_array
31293129 ]
31303130 data = {
31313131 "has_mean" : False ,
@@ -3139,20 +3139,23 @@ def update_veolia_historical_data(self, stats_array):
31393139 "stats" : total_stats ,
31403140 }
31413141
3142- self .mylog (f"Publish all the historical data in the statistics of _total sensor : { total_stats } " )
3142+ self .mylog (
3143+ "Publish all the historical data in the statistics"
3144+ f" of _total sensor : { total_stats } "
3145+ )
31433146 self .open_url (HA_API_STATISTICS , data )
31443147 self .mylog (st = "OK" )
31453148
31463149 # Prepare the statistics that need to be sent
31473150 period_stats = [
3148- {
3149- "start" : stat ["start" ],
3150- "state" : stat ["state" ],
3151- "mean" : stat ["state" ],
3152- "min" : stat ["state" ],
3153- "max" : stat ["state" ]
3154- }
3155- for stat in stats_array
3151+ {
3152+ "start" : stat ["start" ],
3153+ "state" : stat ["state" ],
3154+ "mean" : stat ["state" ],
3155+ "min" : stat ["state" ],
3156+ "max" : stat ["state" ],
3157+ }
3158+ for stat in stats_array
31563159 ]
31573160 data = {
31583161 "has_mean" : True ,
@@ -3165,7 +3168,10 @@ def update_veolia_historical_data(self, stats_array):
31653168 "source" : "recorder" ,
31663169 "stats" : period_stats ,
31673170 }
3168- self .mylog (f"Publish all the historical data in the statistics of _period_total sensor : { period_stats } " )
3171+ self .mylog (
3172+ "Publish all the historical data in the statistics of"
3173+ f" _period_total sensor : { period_stats } "
3174+ )
31693175 self .open_url (HA_API_STATISTICS , data )
31703176 self .mylog (st = "OK" )
31713177
0 commit comments