-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
since paths is used as constant I moved it
- Loading branch information
Showing
3 changed files
with
40 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,44 @@ | ||
'''Global constants''' | ||
|
||
# region formatting helping functions (used in constant) | ||
def _kwh(_p, value: float) -> str: | ||
return f"{round(value, 2)}KWh" | ||
|
||
def _a(_p, value: float) -> str: | ||
return f"{round(value, 1)}A" | ||
|
||
def _w(_p, value: float) -> str: | ||
return f"{round(value, 1)}W" | ||
|
||
def _v(_p, value: float) -> str: | ||
return f"{round(value, 1)}V" | ||
# endregion | ||
|
||
DTUVARIANT_AHOY = "ahoy" | ||
DTUVARIANT_OPENDTU = "opendtu" | ||
DTUVARIANT_TEMPLATE = "template" | ||
|
||
|
||
VICTRON_PATHS = { | ||
"/Ac/Energy/Forward": { | ||
"initial": None, | ||
"textformat": _kwh, | ||
}, # energy produced by pv inverter | ||
"/Ac/Power": {"initial": None, "textformat": _w}, | ||
"/Ac/L1/Voltage": {"initial": None, "textformat": _v}, | ||
"/Ac/L2/Voltage": {"initial": None, "textformat": _v}, | ||
"/Ac/L3/Voltage": {"initial": None, "textformat": _v}, | ||
"/Ac/L1/Current": {"initial": None, "textformat": _a}, | ||
"/Ac/L2/Current": {"initial": None, "textformat": _a}, | ||
"/Ac/L3/Current": {"initial": None, "textformat": _a}, | ||
"/Ac/L1/Power": {"initial": None, "textformat": _w}, | ||
"/Ac/L2/Power": {"initial": None, "textformat": _w}, | ||
"/Ac/L3/Power": {"initial": None, "textformat": _w}, | ||
"/Ac/L1/Energy/Forward": {"initial": None, "textformat": _kwh}, | ||
"/Ac/L2/Energy/Forward": {"initial": None, "textformat": _kwh}, | ||
"/Ac/L3/Energy/Forward": {"initial": None, "textformat": _kwh}, | ||
"/Ac/Out/L1/I": {"initial": None, "textformat": _a}, | ||
"/Ac/Out/L1/V": {"initial": None, "textformat": _v}, | ||
"/Ac/Out/L1/P": {"initial": None, "textformat": _w}, | ||
"/Dc/0/Voltage": {"initial": None, "textformat": _v}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters