Skip to content

Commit 1a642ca

Browse files
author
Carsten
committed
Icons. Proper populating of selects.
1 parent 7113f47 commit 1a642ca

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

custom_components/solax_modbus/plugin_sofar.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ def value_function_passivemode(initval, descr, datadict):
110110
]
111111

112112
def value_function_passive_timeout(initval, descr, datadict):
113-
return [ ('passive_mode_timeout', datadict.get('passive_mode_timeout', 0), ),
114-
('passive_mode_timeout_action', datadict.get('passive_mode_timeout_action', 0), ),
113+
return [ ('passive_mode_timeout', datadict.get('passive_mode_timeout', datadict.get('passive_mode_timeout')), ),
114+
('passive_mode_timeout_action', datadict.get('passive_mode_timeout_action', datadict.get('passive_mode_timeout_action')), ),
115115
]
116116

117117
def value_function_refluxcontrol(initval, descr, datadict):
@@ -226,6 +226,7 @@ def value_function_toumode(initval, descr, datadict):
226226
allowedtypes = HYBRID,
227227
prevent_update = True,
228228
write_method = WRITE_DATA_LOCAL,
229+
icon = "mdi:transmission-tower",
229230
),
230231
SofarModbusNumberEntityDescription(
231232
name = "Passive: Minimum Batter Power",
@@ -241,6 +242,7 @@ def value_function_toumode(initval, descr, datadict):
241242
allowedtypes = HYBRID,
242243
prevent_update = True,
243244
write_method = WRITE_DATA_LOCAL,
245+
icon = "mdi:battery-arrow-down",
244246
),
245247
SofarModbusNumberEntityDescription(
246248
name = "Passive: Maximum Battery Power",
@@ -256,6 +258,7 @@ def value_function_toumode(initval, descr, datadict):
256258
allowedtypes = HYBRID,
257259
prevent_update = True,
258260
write_method = WRITE_DATA_LOCAL,
261+
icon = "mdi:battery-arrow-up",
259262
),
260263
SofarModbusNumberEntityDescription(
261264
name = "Reflux Power",
@@ -512,6 +515,7 @@ def value_function_toumode(initval, descr, datadict):
512515
7200: "120 Minutes",
513516
},
514517
allowedtypes = HYBRID,
518+
icon = "mdi:timer",
515519
),
516520
SofarModbusSelectEntityDescription(
517521
name = "Passive: Timeout Action",
@@ -523,6 +527,7 @@ def value_function_toumode(initval, descr, datadict):
523527
1: "Return to Previous Mode",
524528
},
525529
allowedtypes = HYBRID,
530+
icon = "mdi:timer-cog",
526531
),
527532
###
528533
#
@@ -599,6 +604,7 @@ def value_function_toumode(initval, descr, datadict):
599604
},
600605
allowedtypes = HYBRID,
601606
write_method = WRITE_MULTISINGLE_MODBUS,
607+
icon = "mdi:battery-charging-60",
602608
),
603609
# Timing Charge Start
604610
# Timing Charge End

0 commit comments

Comments
 (0)