Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add MultipleInputPCS Class #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pychonet/MultipleInputPCS.py
Original file line number Diff line number Diff line change
@@ -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
)
2 changes: 2 additions & 0 deletions pychonet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading