mirror of
https://github.com/janishutz/BiogasControllerApp.git
synced 2025-11-25 13:54:24 +00:00
Compare commits
2 Commits
00773612c3
...
f8fb015de3
| Author | SHA1 | Date | |
|---|---|---|---|
| f8fb015de3 | |||
| d1ba8d4d0e |
@@ -208,7 +208,7 @@ if __name__ == "__main__":
|
||||
|
||||
# Start the application
|
||||
try:
|
||||
if hasattr(sys, '_MEIPASS'):
|
||||
if hasattr(sys, "_MEIPASS"):
|
||||
resource_add_path(os.path.join(sys._MEIPASS))
|
||||
BiogasControllerApp().run()
|
||||
except Exception as e:
|
||||
|
||||
@@ -47,11 +47,12 @@ def read_config(
|
||||
key_0: The first key (top level)
|
||||
key_1: The second key (where the actual key-value pair is)
|
||||
default: The default value to return if the check fails
|
||||
valid_entries: [Optiona] The entries that are valid ones to check against
|
||||
valid_entries: [Optional] The entries that are valid ones to check against
|
||||
type_to_validate: [Optional] Data type to validate
|
||||
|
||||
Returns:
|
||||
[TODO:return]
|
||||
The read config option as a string. You can cast this to the type you specified with type_to_validate safely.
|
||||
When converting to a boolean though, use the str_to_bool function provided by this library
|
||||
"""
|
||||
# Try loading the keys
|
||||
tmp = {}
|
||||
|
||||
@@ -249,7 +249,7 @@ class Com(ControllerConnection):
|
||||
def __add_integer_as_hex(self, c: int):
|
||||
"""Writes the hexadecimal representation of the high and low bytes of integer `c` (16-bit) to the simulated serial port."""
|
||||
if not (0 <= c <= 0xFFFF):
|
||||
raise ValueError("Input must be a 16-bit integer (0–65535)")
|
||||
raise ValueError("Input must be a 16-bit integer (0-65535)")
|
||||
|
||||
# Get high byte (most significant byte)
|
||||
hi_byte = (c >> 8) & 0xFF
|
||||
|
||||
Reference in New Issue
Block a user