Skip to content

Commit

Permalink
Merge pull request #41 from AnotherDaniel/develop
Browse files Browse the repository at this point in the history
Fix deprecated function call in EVCharger
  • Loading branch information
AnotherDaniel authored Feb 10, 2024
2 parents 3f1ec4f + d8b10de commit 612790a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions plugins/sources/EVCharger/evcharger.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
from utils.smahelpers import parameter_unit, isfloat
from utils.smahelpers import isfloat
from utils.smasensors import register_sensor_dict, get_parameter_unit


Expand Down Expand Up @@ -124,7 +124,7 @@ def execute(config, add_data, dostop):
v = d['values'][0]['value']
if isfloat(v):
v = round(v, 2)
unit = parameter_unit(name)
unit = get_parameter_unit('SENSORS_EVCHARGER', name)
if unit:
add_data(dname, (v, unit))
else:
Expand All @@ -136,7 +136,7 @@ def execute(config, add_data, dostop):
if isfloat(v):
v = round(v, 2)
idxname = dname + "." + str(idx + 1)
unit = parameter_unit(name)
unit = get_parameter_unit('SENSORS_EVCHARGER', name)
if unit:
add_data(idxname, (v, unit))
else:
Expand Down Expand Up @@ -402,4 +402,4 @@ def execute(config, add_data, dostop):
'name': "PlantControl PCC ChrgActCnt",
},

]
]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]

[project]
name = "smahub"
version = "1.6"
version = "1.6.1"
authors = [{ name = "Daniel Krippner", email = "[email protected]" }]
description = "Little daemon that runs plugins for collecting data from SMA PV products, and publishes to eg MQTT via other plugins."
readme = "README.md"
Expand Down
3 changes: 3 additions & 0 deletions src/smahub.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import signal
import logging
import debugpy

from smadict import SMA_Dict

# Configure logging to print warn-level messages to the console
Expand Down Expand Up @@ -204,6 +205,8 @@ async def main(args):
logging.info(f"Holding startup, waiting for debug connection on port: {args.debug_port}")
debugpy.wait_for_client()

logging.info(f"Starting {package_name} {version}")

# Main business logic
load_plugins(args.source_dir, sources)
load_plugins(args.sink_dir, sinks)
Expand Down

0 comments on commit 612790a

Please sign in to comment.