Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ngardiner/TWCManager into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ngardiner committed Jan 31, 2025
2 parents 450ede5 + 8460b20 commit 9d42891
Show file tree
Hide file tree
Showing 36 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion lib/TWCManager/Control/HTTPControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import urllib.parse
import uuid

logger = logging.getLogger("\U0001F3AE HTTP")
logger = logging.getLogger("\U0001f3ae HTTP")


class ThreadingSimpleServer(ThreadingMixIn, HTTPServer):
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/Control/MQTTControl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

logger = logging.getLogger("\U0001F3AE MQTT")
logger = logging.getLogger("\U0001f3ae MQTT")


class MQTTControl:
Expand Down
4 changes: 2 additions & 2 deletions lib/TWCManager/Control/WebIPCControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,13 @@ def processIPC(self):
else 13
),
)
if (twcMsg[0:2] == b"\xFC\x19") or (twcMsg[0:2] == b"\xFC\x1A"):
if (twcMsg[0:2] == b"\xfc\x19") or (twcMsg[0:2] == b"\xfc\x1a"):
logger.info(
"\n*** ERROR: Web interface requested sending command:\n"
+ self.master.hex_str(twcMsg)
+ "\nwhich could permanently disable the TWC. Aborting.\n"
)
elif twcMsg[0:2] == b"\xFB\xE8":
elif twcMsg[0:2] == b"\xfb\xe8":
logger.info(
"\n*** ERROR: Web interface requested sending command:\n"
+ self.master.hex_str(twcMsg)
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/DSMRreader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import json

logger = logging.getLogger("\U000026A1 DSMRread")
logger = logging.getLogger("\U000026a1 DSMRread")


class DSMRreader:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/Efergy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time
import logging

logger = logging.getLogger("\U000026A1 Efergy")
logger = logging.getLogger("\U000026a1 Efergy")


class Efergy:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/EmonCMS.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

logger = logging.getLogger("\U000026A1 EmonCMS")
logger = logging.getLogger("\U000026a1 EmonCMS")


class EmonCMS:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/Enphase.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import time

logger = logging.getLogger("\U000026C5 Enphase")
logger = logging.getLogger("\U000026c5 Enphase")


class Enphase:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/Fronius.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests
import time

logger = logging.getLogger("\U000026C5 Fronius")
logger = logging.getLogger("\U000026c5 Fronius")


class Fronius:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/Growatt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import datetime


logger = logging.getLogger("\U000026C5 Growatt")
logger = logging.getLogger("\U000026c5 Growatt")


class Growatt:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/HASS.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

logger = logging.getLogger("\U000026A1 HASS")
logger = logging.getLogger("\U000026a1 HASS")


class HASS:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/IotaWatt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

logger = logging.getLogger("\U000026C5 IotaWatt")
logger = logging.getLogger("\U000026c5 IotaWatt")


class IotaWatt:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/Kostal.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
ENDIAN_BIG = 0x01 # big endian (ABCD) Sunspec
ENDIAN_LITTLE = 0x00 # little endian (CDAB) Standard Modbus

logger = logging.getLogger("\U000026C5 Kostal")
logger = logging.getLogger("\U000026c5 Kostal")


#
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/MQTT.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

logger = logging.getLogger("\U000026A1 MQTT")
logger = logging.getLogger("\U000026a1 MQTT")


class MQTT:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/OpenHab.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import requests
import time

logger = logging.getLogger("\U000026A1 OpenHab")
logger = logging.getLogger("\U000026a1 OpenHab")


class OpenHab:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/OpenWeatherMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests
import time

logger = logging.getLogger("\U000026C5 OpenWthr")
logger = logging.getLogger("\U000026c5 OpenWthr")


class OpenWeatherMap:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/P1Monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import scipy.stats
import json

logger = logging.getLogger("\U000026A1 P1Monitr")
logger = logging.getLogger("\U000026a1 P1Monitr")


class P1Monitor:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/SmartMe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

logger = logging.getLogger("\U000026A1 SmartMe")
logger = logging.getLogger("\U000026a1 SmartMe")


class SmartMe:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/SmartPi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import requests
import time

logger = logging.getLogger("\U000026A1 SmartPi")
logger = logging.getLogger("\U000026a1 SmartPi")


class SmartPi:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/SolarEdge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import time
import solaredge_modbus

logger = logging.getLogger("\U000026C5 SolarEdg")
logger = logging.getLogger("\U000026c5 SolarEdg")


class SolarEdge:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/SolarLog.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import time

logger = logging.getLogger("\U000026C5 SolarLog")
logger = logging.getLogger("\U000026c5 SolarLog")


class SolarLog:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/TED.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time


logger = logging.getLogger("\U000026C5 TED")
logger = logging.getLogger("\U000026c5 TED")


class TED:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/TeslaPowerwall2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import time

logger = logging.getLogger("\U000026C5 TeslaPwl")
logger = logging.getLogger("\U000026c5 TeslaPwl")


class TeslaPowerwall2:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/URL.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import requests
import time

logger = logging.getLogger("\U000026A1 URL")
logger = logging.getLogger("\U000026a1 URL")


class URL:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EMS/Volkszahler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import time
import re

logger = logging.getLogger("\U000026C5 Volkszlr")
logger = logging.getLogger("\U000026c5 Volkszlr")


class Volkszahler:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/Interface/Dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def send(self, msg):
"Command": "SlaveLinkready",
"SenderID": self.twcID,
"Sign": self.master.getSlaveSign(),
"Amps": bytearray(b"\x1F\x40"),
"Amps": bytearray(b"\x1f\x40"),
}
)
)
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/Interface/RS485.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import time

logger = logging.getLogger("\U0001F50C RS485")
logger = logging.getLogger("\U0001f50c RS485")


class RS485:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/Policy/Policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time


logger = logging.getLogger("\u26FD Policy")
logger = logging.getLogger("\u26fd Policy")


class Policy:
Expand Down
6 changes: 3 additions & 3 deletions lib/TWCManager/Protocol/TWCProtocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def createMessage(self, packet):

elif packet["Command"] == "GetFirmwareVersion":
msg = (
bytearray(b"\xFB\x1B")
bytearray(b"\xfb\x1b")
+ packet["SenderID"]
+ packet["RecieverID"]
+ bytearray(b"\x00\x00\xa0\x00\x00\x00\x00")
Expand All @@ -77,7 +77,7 @@ def createMessage(self, packet):

elif packet["Command"] == "SlaveHeartbeat":
msg = (
bytearray(b"\xFD\xE0")
bytearray(b"\xfd\xe0")
+ packet["SenderID"]
+ packet["RecieverID"]
+ bytearray(b"\x00\x00\xa0\x00\x00\x00\x00")
Expand All @@ -89,7 +89,7 @@ def createMessage(self, packet):

elif packet["Command"] == "SlaveLinkready":
msg = (
bytearray(b"\xFD\xE2")
bytearray(b"\xfd\xe2")
+ packet["SenderID"]
+ packet["Sign"]
+ packet["Amps"]
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/Status/HASSStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time


logger = logging.getLogger("\U0001F4CA HASS")
logger = logging.getLogger("\U0001f4ca HASS")


class HASSStatus:
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/Status/MQTTStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time


logger = logging.getLogger("\U0001F4CA MQTT")
logger = logging.getLogger("\U0001f4ca MQTT")


class MQTTStatus:
Expand Down
22 changes: 11 additions & 11 deletions lib/TWCManager/TWCManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
logging.DEBUG2 = 9


logger = logging.getLogger("\u26FD Manager")
logger = logging.getLogger("\u26fd Manager")

# Define available modules for the instantiator
# All listed modules will be loaded at boot time
Expand Down Expand Up @@ -928,14 +928,14 @@ def update_sunrise_sunset():
# voltage/kWh report.
if (
master.lastTWCResponseMsg == b""
and msg[0:2] != b"\xFB\xE0"
and msg[0:2] != b"\xFD\xE0"
and msg[0:2] != b"\xFC\xE1"
and msg[0:2] != b"\xFB\xE2"
and msg[0:2] != b"\xFD\xE2"
and msg[0:2] != b"\xFB\xEB"
and msg[0:2] != b"\xFD\xEB"
and msg[0:2] != b"\xFD\xE0"
and msg[0:2] != b"\xfb\xe0"
and msg[0:2] != b"\xfd\xe0"
and msg[0:2] != b"\xfc\xe1"
and msg[0:2] != b"\xfb\xe2"
and msg[0:2] != b"\xfd\xe2"
and msg[0:2] != b"\xfb\xeb"
and msg[0:2] != b"\xfd\xeb"
and msg[0:2] != b"\xfd\xe0"
):
master.lastTWCResponseMsg = msg

Expand Down Expand Up @@ -1720,10 +1720,10 @@ def update_sunrise_sunset():
)
)
master.getInterfaceModule().send(
bytearray(b"\xFD\xEB")
bytearray(b"\xfd\xeb")
+ fakeTWCID
+ kWhPacked
+ bytearray(b"\x00\xF0\x00\x00\x00\x00\x00")
+ bytearray(b"\x00\xf0\x00\x00\x00\x00\x00")
)
else:
msgMatch = re.search(
Expand Down
Loading

0 comments on commit 9d42891

Please sign in to comment.