Skip to content

Commit

Permalink
added sematic versioning to image
Browse files Browse the repository at this point in the history
  • Loading branch information
hahahannes committed Jul 2, 2024
1 parent 8de46fe commit 94827af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]-alpha[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]-beta[0-9]+'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -36,4 +40,4 @@ jobs:
push: true
tags: |
smartenergyplatform/smart-meter-dc:prod
ghcr.io/senergy-platform/smart-meter-dc:prod
ghcr.io/senergy-platform/smart-meter-dc::${{ github.ref_name }}
4 changes: 2 additions & 2 deletions Modfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ modfileVersion: "v1"
id: github.com/SENERGY-Platform/mgw-smart-meter-dc
name: Smart Meter Device Connector
description:
version: v1.0.7
version: v1.0.8
type: add-on
deploymentType: single
services:
connector:
name: Connector
image: ghcr.io/senergy-platform/smart-meter-dc:prod
image: ghcr.io/senergy-platform/smart-meter-dc:v1.0.8

dependencies:
github.com/SENERGY-Platform/mgw-mqtt-broker:
Expand Down
4 changes: 3 additions & 1 deletion smart_meter/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ def probe_ports(ports: list) -> list:
smart_meters = list()
for port in ports:
try:
logger.debug(f"try readiing from device {port}")
srl_adptr = SerialAdapter(port)
mfr_id, sm_id = srl_adptr.identify()
if mfr_id and sm_id:
logger.info("found smart meter '{}' with id '{}' on '{}'".format(mfr_id, sm_id, port))
smart_meters.append(("{}{}".format(conf.Discovery.device_id_prefix, sm_id), mfr_id, srl_adptr))
except ReadError:
except ReadError as e:
logger.error("cant read from serial '{}'".format(e))
pass
return smart_meters

Expand Down

0 comments on commit 94827af

Please sign in to comment.