Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06d2ae246e | ||
|
|
391c3f7824 | ||
|
|
739419e3ee | ||
|
|
d2ff6f4bb9 | ||
|
|
a316d93082 |
@@ -17,6 +17,7 @@ jobs:
|
|||||||
- '3.9'
|
- '3.9'
|
||||||
- '3.10'
|
- '3.10'
|
||||||
- '3.11'
|
- '3.11'
|
||||||
|
- '3.12'
|
||||||
|
|
||||||
name: Python ${{ matrix.python-version }}
|
name: Python ${{ matrix.python-version }}
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ INSTANTANEOUS_VOLTAGE_L3 = r'^\d-\d:72\.7\.0.+?\r\n'
|
|||||||
INSTANTANEOUS_CURRENT_L1 = r'^\d-\d:31\.7\.0.+?\r\n'
|
INSTANTANEOUS_CURRENT_L1 = r'^\d-\d:31\.7\.0.+?\r\n'
|
||||||
INSTANTANEOUS_CURRENT_L2 = r'^\d-\d:51\.7\.0.+?\r\n'
|
INSTANTANEOUS_CURRENT_L2 = r'^\d-\d:51\.7\.0.+?\r\n'
|
||||||
INSTANTANEOUS_CURRENT_L3 = r'^\d-\d:71\.7\.0.+?\r\n'
|
INSTANTANEOUS_CURRENT_L3 = r'^\d-\d:71\.7\.0.+?\r\n'
|
||||||
|
FUSE_THRESHOLD_L1 = r'^\d-\d:31\.4\.0.+?\r\n' # Applicable when current limitation is active
|
||||||
|
FUSE_THRESHOLD_L2 = r'^\d-\d:51\.4\.0.+?\r\n' # Applicable when current limitation is active
|
||||||
|
FUSE_THRESHOLD_L3 = r'^\d-\d:71\.4\.0.+?\r\n' # Applicable when current limitation is active
|
||||||
TEXT_MESSAGE_CODE = r'^\d-\d:96\.13\.1.+?\r\n'
|
TEXT_MESSAGE_CODE = r'^\d-\d:96\.13\.1.+?\r\n'
|
||||||
TEXT_MESSAGE = r'^\d-\d:96\.13\.0.+?\r\n'
|
TEXT_MESSAGE = r'^\d-\d:96\.13\.0.+?\r\n'
|
||||||
DEVICE_TYPE = r'^\d-\d:24\.1\.0.+?\r\n'
|
DEVICE_TYPE = r'^\d-\d:24\.1\.0.+?\r\n'
|
||||||
@@ -88,8 +91,6 @@ BELGIUM_EQUIPMENT_IDENTIFIER = r'^\d-0:96\.1\.1.+?\r\n'
|
|||||||
BELGIUM_CURRENT_AVERAGE_DEMAND = r'^\d-\d:1\.4\.0.+?\r\n'
|
BELGIUM_CURRENT_AVERAGE_DEMAND = r'^\d-\d:1\.4\.0.+?\r\n'
|
||||||
BELGIUM_MAXIMUM_DEMAND_MONTH = r'^\d-\d:1\.6\.0.+?\r\n'
|
BELGIUM_MAXIMUM_DEMAND_MONTH = r'^\d-\d:1\.6\.0.+?\r\n'
|
||||||
BELGIUM_MAXIMUM_DEMAND_13_MONTHS = r'^\d-\d:98\.1\.0.+?\r\n'
|
BELGIUM_MAXIMUM_DEMAND_13_MONTHS = r'^\d-\d:98\.1\.0.+?\r\n'
|
||||||
BELGIUM_MAX_POWER_PER_PHASE = r'^\d-\d:17\.0\.0.+?\r\n' # Applicable when power limitation is active
|
|
||||||
BELGIUM_MAX_CURRENT_PER_PHASE = r'^\d-\d:31\.4\.0.+?\r\n' # Applicable when current limitation is active
|
|
||||||
|
|
||||||
# Multiple 'slaves' can be linked to the main device.
|
# Multiple 'slaves' can be linked to the main device.
|
||||||
# Mostly MBUS1 = GAS METER with values on 24.2.3
|
# Mostly MBUS1 = GAS METER with values on 24.2.3
|
||||||
@@ -142,5 +143,3 @@ EON_HU_INSTANTANEOUS_REACTIVE_POWER_Q1 = r'^\d-\d:5\.7\.0.+?\r\n'
|
|||||||
EON_HU_INSTANTANEOUS_REACTIVE_POWER_Q2 = r'^\d-\d:6\.7\.0.+?\r\n'
|
EON_HU_INSTANTANEOUS_REACTIVE_POWER_Q2 = r'^\d-\d:6\.7\.0.+?\r\n'
|
||||||
EON_HU_INSTANTANEOUS_REACTIVE_POWER_Q3 = r'^\d-\d:7\.7\.0.+?\r\n'
|
EON_HU_INSTANTANEOUS_REACTIVE_POWER_Q3 = r'^\d-\d:7\.7\.0.+?\r\n'
|
||||||
EON_HU_INSTANTANEOUS_REACTIVE_POWER_Q4 = r'^\d-\d:8\.7\.0.+?\r\n'
|
EON_HU_INSTANTANEOUS_REACTIVE_POWER_Q4 = r'^\d-\d:8\.7\.0.+?\r\n'
|
||||||
EON_HU_MAX_POWER_ON_L2 = r'^\d-\d:51\.4\.0.+?\r\n'
|
|
||||||
EON_HU_MAX_POWER_ON_L3 = r'^\d-\d:71\.4\.0.+?\r\n'
|
|
||||||
|
|||||||
@@ -625,14 +625,14 @@ BELGIUM_FLUVIUS = {
|
|||||||
'value_name': 'ACTUAL_TRESHOLD_ELECTRICITY'
|
'value_name': 'ACTUAL_TRESHOLD_ELECTRICITY'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'obis_reference': obis.BELGIUM_MAX_POWER_PER_PHASE,
|
'obis_reference': obis.ACTUAL_TRESHOLD_ELECTRICITY,
|
||||||
'value_parser': CosemParser(ValueParser(Decimal)),
|
'value_parser': CosemParser(ValueParser(Decimal)),
|
||||||
'value_name': 'BELGIUM_MAX_POWER_PER_PHASE'
|
'value_name': 'ACTUAL_TRESHOLD_ELECTRICITY'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'obis_reference': obis.BELGIUM_MAX_CURRENT_PER_PHASE,
|
'obis_reference': obis.FUSE_THRESHOLD_L1,
|
||||||
'value_parser': CosemParser(ValueParser(Decimal)),
|
'value_parser': CosemParser(ValueParser(Decimal)),
|
||||||
'value_name': 'BELGIUM_MAX_CURRENT_PER_PHASE'
|
'value_name': 'FUSE_THRESHOLD_L1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'obis_reference': obis.TEXT_MESSAGE,
|
'obis_reference': obis.TEXT_MESSAGE,
|
||||||
@@ -1233,7 +1233,7 @@ EON_HUNGARY = {
|
|||||||
# This seems to be wrong in documentation, it's not 0-0:96.50.68, but 0-0:96.3.10
|
# This seems to be wrong in documentation, it's not 0-0:96.50.68, but 0-0:96.3.10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'obis_reference': obis.BELGIUM_MAX_POWER_PER_PHASE,
|
'obis_reference': obis.ACTUAL_TRESHOLD_ELECTRICITY,
|
||||||
'value_parser': CosemParser(ValueParser(Decimal)),
|
'value_parser': CosemParser(ValueParser(Decimal)),
|
||||||
'value_name': 'ACTUAL_TRESHOLD_ELECTRICITY'
|
'value_name': 'ACTUAL_TRESHOLD_ELECTRICITY'
|
||||||
},
|
},
|
||||||
@@ -1414,20 +1414,20 @@ EON_HUNGARY = {
|
|||||||
'value_name': 'INSTANTANEOUS_REACTIVE_POWER_Q4'
|
'value_name': 'INSTANTANEOUS_REACTIVE_POWER_Q4'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'obis_reference': obis.BELGIUM_MAX_CURRENT_PER_PHASE,
|
'obis_reference': obis.FUSE_THRESHOLD_L1,
|
||||||
'value_parser': CosemParser(ValueParser(Decimal)),
|
'value_parser': CosemParser(ValueParser(Decimal)),
|
||||||
'value_name': 'MAX_POWER_ON_L1'
|
'value_name': 'FUSE_THRESHOLD_L1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'obis_reference': obis.EON_HU_MAX_POWER_ON_L2,
|
'obis_reference': obis.FUSE_THRESHOLD_L2,
|
||||||
'value_parser': CosemParser(ValueParser(Decimal)),
|
'value_parser': CosemParser(ValueParser(Decimal)),
|
||||||
'value_name': 'MAX_POWER_ON_L2'
|
'value_name': 'FUSE_THRESHOLD_L2'
|
||||||
# Only with 3 phase meters
|
# Only with 3 phase meters
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'obis_reference': obis.EON_HU_MAX_POWER_ON_L3,
|
'obis_reference': obis.FUSE_THRESHOLD_L3,
|
||||||
'value_parser': CosemParser(ValueParser(Decimal)),
|
'value_parser': CosemParser(ValueParser(Decimal)),
|
||||||
'value_name': 'MAX_POWER_ON_L3'
|
'value_name': 'FUSE_THRESHOLD_L3'
|
||||||
# Only with 3 phase meters
|
# Only with 3 phase meters
|
||||||
},
|
},
|
||||||
# I'm not sure which datas does this line containes. It should be the data of last minute of last month.
|
# I'm not sure which datas does this line containes. It should be the data of last minute of last month.
|
||||||
|
|||||||
+12
-14
@@ -211,17 +211,17 @@ class TelegramParserFluviusTest(unittest.TestCase):
|
|||||||
assert isinstance(result.ACTUAL_SWITCH_POSITION.value, int)
|
assert isinstance(result.ACTUAL_SWITCH_POSITION.value, int)
|
||||||
assert result.ACTUAL_SWITCH_POSITION.value == 1
|
assert result.ACTUAL_SWITCH_POSITION.value == 1
|
||||||
|
|
||||||
# BELGIUM_MAX_POWER_PER_PHASE (0-0:17.0.0)
|
# ACTUAL_TRESHOLD_ELECTRICITY (0-0:17.0.0)
|
||||||
assert isinstance(result.BELGIUM_MAX_POWER_PER_PHASE, CosemObject)
|
assert isinstance(result.ACTUAL_TRESHOLD_ELECTRICITY, CosemObject)
|
||||||
assert result.BELGIUM_MAX_POWER_PER_PHASE.unit == 'kW'
|
assert result.ACTUAL_TRESHOLD_ELECTRICITY.unit == 'kW'
|
||||||
assert isinstance(result.BELGIUM_MAX_POWER_PER_PHASE.value, Decimal)
|
assert isinstance(result.ACTUAL_TRESHOLD_ELECTRICITY.value, Decimal)
|
||||||
assert result.BELGIUM_MAX_POWER_PER_PHASE.value == Decimal('999.9')
|
assert result.ACTUAL_TRESHOLD_ELECTRICITY.value == Decimal('999.9')
|
||||||
|
|
||||||
# BELGIUM_MAX_POWER_PER_PHASE (1-0:31.4.0)
|
# FUSE_THRESHOLD_L1 (1-0:31.4.0)
|
||||||
assert isinstance(result.BELGIUM_MAX_CURRENT_PER_PHASE, CosemObject)
|
assert isinstance(result.FUSE_THRESHOLD_L1, CosemObject)
|
||||||
assert result.BELGIUM_MAX_CURRENT_PER_PHASE.unit == 'A'
|
assert result.FUSE_THRESHOLD_L1.unit == 'A'
|
||||||
assert isinstance(result.BELGIUM_MAX_CURRENT_PER_PHASE.value, Decimal)
|
assert isinstance(result.FUSE_THRESHOLD_L1.value, Decimal)
|
||||||
assert result.BELGIUM_MAX_CURRENT_PER_PHASE.value == Decimal('999')
|
assert result.FUSE_THRESHOLD_L1.value == Decimal('999')
|
||||||
|
|
||||||
# TEXT_MESSAGE (0-0:96.13.0)
|
# TEXT_MESSAGE (0-0:96.13.0)
|
||||||
assert isinstance(result.TEXT_MESSAGE, CosemObject)
|
assert isinstance(result.TEXT_MESSAGE, CosemObject)
|
||||||
@@ -336,8 +336,7 @@ class TelegramParserFluviusTest(unittest.TestCase):
|
|||||||
'INSTANTANEOUS_CURRENT_L3': {'value': 0.52, 'unit': 'A'},
|
'INSTANTANEOUS_CURRENT_L3': {'value': 0.52, 'unit': 'A'},
|
||||||
'ACTUAL_SWITCH_POSITION': {'value': 1, 'unit': None},
|
'ACTUAL_SWITCH_POSITION': {'value': 1, 'unit': None},
|
||||||
'ACTUAL_TRESHOLD_ELECTRICITY': {'value': 999.9, 'unit': 'kW'},
|
'ACTUAL_TRESHOLD_ELECTRICITY': {'value': 999.9, 'unit': 'kW'},
|
||||||
'BELGIUM_MAX_POWER_PER_PHASE': {'value': 999.9, 'unit': 'kW'},
|
'FUSE_THRESHOLD_L1': {'value': 999.0, 'unit': 'A'},
|
||||||
'BELGIUM_MAX_CURRENT_PER_PHASE': {'value': 999.0, 'unit': 'A'},
|
|
||||||
'TEXT_MESSAGE': {'value': None, 'unit': None},
|
'TEXT_MESSAGE': {'value': None, 'unit': None},
|
||||||
'BELGIUM_MBUS1_DEVICE_TYPE': {'value': 3, 'unit': None},
|
'BELGIUM_MBUS1_DEVICE_TYPE': {'value': 3, 'unit': None},
|
||||||
'MBUS_DEVICES': [{'BELGIUM_MBUS1_DEVICE_TYPE': {'value': 3, 'unit': None},
|
'MBUS_DEVICES': [{'BELGIUM_MBUS1_DEVICE_TYPE': {'value': 3, 'unit': None},
|
||||||
@@ -398,8 +397,7 @@ class TelegramParserFluviusTest(unittest.TestCase):
|
|||||||
'INSTANTANEOUS_CURRENT_L3: 0.52 [A]\n'
|
'INSTANTANEOUS_CURRENT_L3: 0.52 [A]\n'
|
||||||
'ACTUAL_SWITCH_POSITION: 1 [None]\n'
|
'ACTUAL_SWITCH_POSITION: 1 [None]\n'
|
||||||
'ACTUAL_TRESHOLD_ELECTRICITY: 999.9 [kW]\n'
|
'ACTUAL_TRESHOLD_ELECTRICITY: 999.9 [kW]\n'
|
||||||
'BELGIUM_MAX_POWER_PER_PHASE: 999.9 [kW]\n'
|
'FUSE_THRESHOLD_L1: 999 [A]\n'
|
||||||
'BELGIUM_MAX_CURRENT_PER_PHASE: 999 [A]\n'
|
|
||||||
'TEXT_MESSAGE: None [None]\n'
|
'TEXT_MESSAGE: None [None]\n'
|
||||||
'BELGIUM_MBUS1_DEVICE_TYPE: 3 [None]\n'
|
'BELGIUM_MBUS1_DEVICE_TYPE: 3 [None]\n'
|
||||||
'MBUS DEVICE (channel 1)\n'
|
'MBUS DEVICE (channel 1)\n'
|
||||||
|
|||||||
@@ -263,23 +263,23 @@ class TelegramParserV5EONHUTest(unittest.TestCase):
|
|||||||
assert isinstance(telegram.INSTANTANEOUS_REACTIVE_POWER_Q4.value, Decimal)
|
assert isinstance(telegram.INSTANTANEOUS_REACTIVE_POWER_Q4.value, Decimal)
|
||||||
assert telegram.INSTANTANEOUS_REACTIVE_POWER_Q4.value == Decimal('00.000')
|
assert telegram.INSTANTANEOUS_REACTIVE_POWER_Q4.value == Decimal('00.000')
|
||||||
|
|
||||||
# EON_HU_MAX_POWER_ON_L1 (1-0:31.4.0)
|
# FUSE_THRESHOLD_L1 (1-0:31.4.0)
|
||||||
assert isinstance(telegram.MAX_POWER_ON_L1, CosemObject)
|
assert isinstance(telegram.FUSE_THRESHOLD_L1, CosemObject)
|
||||||
assert telegram.MAX_POWER_ON_L1.unit == 'A'
|
assert telegram.FUSE_THRESHOLD_L1.unit == 'A'
|
||||||
assert isinstance(telegram.MAX_POWER_ON_L1.value, Decimal)
|
assert isinstance(telegram.FUSE_THRESHOLD_L1.value, Decimal)
|
||||||
assert telegram.MAX_POWER_ON_L1.value == Decimal('200.00')
|
assert telegram.FUSE_THRESHOLD_L1.value == Decimal('200.00')
|
||||||
|
|
||||||
# EON_HU_MAX_POWER_ON_L2 (1-0:31.4.0)
|
# FUSE_THRESHOLD_L2 (1-0:31.4.0)
|
||||||
assert isinstance(telegram.MAX_POWER_ON_L2, CosemObject)
|
assert isinstance(telegram.FUSE_THRESHOLD_L2, CosemObject)
|
||||||
assert telegram.MAX_POWER_ON_L2.unit == 'A'
|
assert telegram.FUSE_THRESHOLD_L2.unit == 'A'
|
||||||
assert isinstance(telegram.MAX_POWER_ON_L2.value, Decimal)
|
assert isinstance(telegram.FUSE_THRESHOLD_L2.value, Decimal)
|
||||||
assert telegram.MAX_POWER_ON_L2.value == Decimal('200.00')
|
assert telegram.FUSE_THRESHOLD_L2.value == Decimal('200.00')
|
||||||
|
|
||||||
# EON_HU_MAX_POWER_ON_L3 (1-0:31.4.0)
|
# FUSE_THRESHOLD_L3 (1-0:31.4.0)
|
||||||
assert isinstance(telegram.MAX_POWER_ON_L3, CosemObject)
|
assert isinstance(telegram.FUSE_THRESHOLD_L3, CosemObject)
|
||||||
assert telegram.MAX_POWER_ON_L3.unit == 'A'
|
assert telegram.FUSE_THRESHOLD_L3.unit == 'A'
|
||||||
assert isinstance(telegram.MAX_POWER_ON_L3.value, Decimal)
|
assert isinstance(telegram.FUSE_THRESHOLD_L3.value, Decimal)
|
||||||
assert telegram.MAX_POWER_ON_L3.value == Decimal('200.00')
|
assert telegram.FUSE_THRESHOLD_L3.value == Decimal('200.00')
|
||||||
|
|
||||||
# TEXT_MESSAGE (0-0:96.13.0)
|
# TEXT_MESSAGE (0-0:96.13.0)
|
||||||
assert isinstance(telegram.TEXT_MESSAGE, CosemObject)
|
assert isinstance(telegram.TEXT_MESSAGE, CosemObject)
|
||||||
|
|||||||
@@ -68,6 +68,6 @@ class ProtocolTest(unittest.TestCase):
|
|||||||
|
|
||||||
# 2nd call of keep_alive should close the transport
|
# 2nd call of keep_alive should close the transport
|
||||||
self.protocol.keep_alive()
|
self.protocol.keep_alive()
|
||||||
assert mock_transport.close.called_once()
|
mock_transport.close.assert_called_once()
|
||||||
|
|
||||||
self.protocol.connection_lost(None)
|
self.protocol.connection_lost(None)
|
||||||
|
|||||||
Reference in New Issue
Block a user