Skip to content

Commit

Permalink
working on #55
Browse files Browse the repository at this point in the history
simple patch
  • Loading branch information
marq24 committed Nov 13, 2024
1 parent 460fa6e commit 3d2767f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions custom_components/tibber_local/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
from datetime import timedelta

import voluptuous as vol
from smllib import SmlStreamReader
from smllib.const import UNITS
from smllib.errors import CrcError
from smllib.sml import SmlListEntry, ObisCode

from homeassistant.config_entries import ConfigEntry, ConfigEntryState
from homeassistant.const import CONF_ID, CONF_HOST, CONF_SCAN_INTERVAL, CONF_PASSWORD, CONF_MODE
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.entity import EntityDescription, Entity
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from smllib import SmlStreamReader
from smllib.const import UNITS
from smllib.errors import CrcError
from smllib.sml import SmlListEntry, ObisCode

from .const import (
DOMAIN,
MANUFACTURE,
Expand Down Expand Up @@ -350,6 +350,12 @@ async def read_plaintext(self, plaintext: str, retry: bool, log_payload: bool):
# a patch for invalid reading?!
# a_line = a_line.replace('."55*', '.255*')

# looks like that in the format 'IEC-62056-21' there are the '1-0:' is missing ?! [this is really
# a very DUMP implementation]
if a_line[1] != '-' and a_line[3] != ':' and '*' in a_line and '(' in a_line and ')' in a_line:
a_line = '1-0:' + a_line
pass

# obis pattern is 'a-b:c.d.e*f'
parts = re.split(self.PLAIN_TEXT_LINE, a_line)
if len(parts) == 9:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/tibber_local/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"documentation": "https://github.com/marq24/ha-tibber-pulse-local/blob/master/README.md",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/marq24/ha-tibber-pulse-local/issues",
"requirements": ["smllib==1.4"],
"version": "2024.10.0"
"requirements": ["smllib==1.5"],
"version": "2024.11.0"
}

0 comments on commit 3d2767f

Please sign in to comment.