Skip to content

Commit 0638273

Browse files
Fix state on charging slot binary sensor
1 parent cf3b713 commit 0638273

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/predbat/predbat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ def publish_car_plan(self):
18211821
plan = []
18221822

18231823
if not self.car_charging_slots:
1824-
self.set_state("binary_sensor.predbat_car_charging_slot", state=False, attributes = {'planned' : plan, 'friendly_name' : 'Predbat car charging slot', 'icon': 'mdi:home-lightning-bolt-outline'})
1824+
self.set_state("binary_sensor.predbat_car_charging_slot", state='off', attributes = {'planned' : plan, 'friendly_name' : 'Predbat car charging slot', 'icon': 'mdi:home-lightning-bolt-outline'})
18251825
else:
18261826
window = self.car_charging_slots[0]
18271827
if self.minutes_now >= window['start'] and self.minutes_now < window['end']:
@@ -1839,7 +1839,7 @@ def publish_car_plan(self):
18391839
show['kwh'] = kwh
18401840
plan.append(show)
18411841

1842-
self.set_state("binary_sensor.predbat_car_charging_slot", state=slot, attributes = {'planned' : plan, 'friendly_name' : 'Predbat car charging slot', 'icon': 'mdi:home-lightning-bolt-outline'})
1842+
self.set_state("binary_sensor.predbat_car_charging_slot", state="on" if slot else 'off', attributes = {'planned' : plan, 'friendly_name' : 'Predbat car charging slot', 'icon': 'mdi:home-lightning-bolt-outline'})
18431843

18441844
def publish_rates_export(self):
18451845
if self.high_export_rates:

0 commit comments

Comments
 (0)