mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add support for Swedish smart electricity meters to DSMR (#54630)
* Add support for Swedish smart electricity meters to DSMR * Use Swedish protocol support from dsmr_parser * Update tests * Bump dsmr_parser to 0.30 * Remove last_reset attribute from Swedish energy sensors
This commit is contained in:
@@ -7,6 +7,7 @@ from dsmr_parser.obis_references import (
|
||||
EQUIPMENT_IDENTIFIER,
|
||||
EQUIPMENT_IDENTIFIER_GAS,
|
||||
LUXEMBOURG_EQUIPMENT_IDENTIFIER,
|
||||
P1_MESSAGE_TIMESTAMP,
|
||||
)
|
||||
from dsmr_parser.objects import CosemObject
|
||||
import pytest
|
||||
@@ -44,6 +45,7 @@ async def dsmr_connection_send_validate_fixture(hass):
|
||||
protocol.telegram = {
|
||||
EQUIPMENT_IDENTIFIER: CosemObject([{"value": "12345678", "unit": ""}]),
|
||||
EQUIPMENT_IDENTIFIER_GAS: CosemObject([{"value": "123456789", "unit": ""}]),
|
||||
P1_MESSAGE_TIMESTAMP: CosemObject([{"value": "12345678", "unit": ""}]),
|
||||
}
|
||||
|
||||
async def connection_factory(*args, **kwargs):
|
||||
@@ -57,6 +59,10 @@ async def dsmr_connection_send_validate_fixture(hass):
|
||||
[{"value": "123456789", "unit": ""}]
|
||||
),
|
||||
}
|
||||
if args[1] == "5S":
|
||||
protocol.telegram = {
|
||||
P1_MESSAGE_TIMESTAMP: CosemObject([{"value": "12345678", "unit": ""}]),
|
||||
}
|
||||
|
||||
return (transport, protocol)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user