diff --git a/pychonet/MultipleInputPCS.py b/pychonet/MultipleInputPCS.py new file mode 100644 index 0000000..ba69613 --- /dev/null +++ b/pychonet/MultipleInputPCS.py @@ -0,0 +1,26 @@ +from pychonet.EchonetInstance import EchonetInstance +from pychonet.lib.epc_functions import _int, _signed_int + + +class MultipleInputPCS(EchonetInstance): + EPC_FUNCTIONS = { + 0xD0: [ + _int, + { + 0x00: "System interconnected (reverse power flow acceptable)", + 0x01: "Output during a power outage", + 0x02: "System interconnected (reverse power flow not acceptable)", + }, + ], # "Grid connection status" + 0xE0: _int, # "Measured cumulative amount of electric energy (normal direction)", + 0xE3: _int, # "Measured cumulative amount of electric energy (reverse direction)", + 0xE7: _signed_int, # "Measured instantaneous amount of electricity", + # 0xE8: "Connected devices", + } + + def __init__(self, host, api_connector, instance=0x1): + self._eojgc = 0x02 + self._eojcc = 0xA5 + EchonetInstance.__init__( + self, host, self._eojgc, self._eojcc, instance, api_connector + ) diff --git a/pychonet/__init__.py b/pychonet/__init__.py index a792fba..103a82e 100644 --- a/pychonet/__init__.py +++ b/pychonet/__init__.py @@ -27,6 +27,7 @@ from .HotWaterGenerator import HotWaterGenerator from .HybridWaterHeater import HybridWaterHeater from .LightingSystem import LightingSystem +from .MultipleInputPCS import MultipleInputPCS from .LowVoltageSmartElectricEnergyMeter import LowVoltageSmartElectricEnergyMeter from .Refrigerator import Refrigerator from .SingleFunctionLighting import SingleFunctionLighting @@ -71,6 +72,7 @@ def Factory(host, server, eojgc, eojcc, eojci=0x01): f"{0x02}-{0x90}": GeneralLighting, f"{0x02}-{0x91}": SingleFunctionLighting, f"{0x02}-{0xA3}": LightingSystem, + f"{0x02}-{0xA5}": MultipleInputPCS, f"{0x02}-{0xA6}": HybridWaterHeater, f"{0x03}-{0xB7}": Refrigerator, None: None,