Skip to content

Commit 3d2767f

Browse files
committed
working on #55
simple patch
1 parent 460fa6e commit 3d2767f

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

custom_components/tibber_local/__init__.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
from datetime import timedelta
55

66
import voluptuous as vol
7+
from smllib import SmlStreamReader
8+
from smllib.const import UNITS
9+
from smllib.errors import CrcError
10+
from smllib.sml import SmlListEntry, ObisCode
11+
712
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
813
from homeassistant.const import CONF_ID, CONF_HOST, CONF_SCAN_INTERVAL, CONF_PASSWORD, CONF_MODE
914
from homeassistant.core import HomeAssistant
1015
from homeassistant.exceptions import ConfigEntryNotReady
1116
from homeassistant.helpers.aiohttp_client import async_get_clientsession
1217
from homeassistant.helpers.entity import EntityDescription, Entity
1318
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
14-
from smllib import SmlStreamReader
15-
from smllib.const import UNITS
16-
from smllib.errors import CrcError
17-
from smllib.sml import SmlListEntry, ObisCode
18-
1919
from .const import (
2020
DOMAIN,
2121
MANUFACTURE,
@@ -350,6 +350,12 @@ async def read_plaintext(self, plaintext: str, retry: bool, log_payload: bool):
350350
# a patch for invalid reading?!
351351
# a_line = a_line.replace('."55*', '.255*')
352352

353+
# looks like that in the format 'IEC-62056-21' there are the '1-0:' is missing ?! [this is really
354+
# a very DUMP implementation]
355+
if a_line[1] != '-' and a_line[3] != ':' and '*' in a_line and '(' in a_line and ')' in a_line:
356+
a_line = '1-0:' + a_line
357+
pass
358+
353359
# obis pattern is 'a-b:c.d.e*f'
354360
parts = re.split(self.PLAIN_TEXT_LINE, a_line)
355361
if len(parts) == 9:

custom_components/tibber_local/manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"documentation": "https://github.com/marq24/ha-tibber-pulse-local/blob/master/README.md",
1010
"iot_class": "local_polling",
1111
"issue_tracker": "https://github.com/marq24/ha-tibber-pulse-local/issues",
12-
"requirements": ["smllib==1.4"],
13-
"version": "2024.10.0"
12+
"requirements": ["smllib==1.5"],
13+
"version": "2024.11.0"
1414
}

0 commit comments

Comments
 (0)