Skip to content

Commit

Permalink
fixed modfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hahahannes committed Jul 2, 2024
1 parent ec588d5 commit 402e156
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
14 changes: 2 additions & 12 deletions Modfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ modfileVersion: "v1"
id: github.com/SENERGY-Platform/mgw-smart-meter-dc
name: Smart Meter Device Connector
description:
version: v1.0.5
version: v1.0.6
type: add-on
deploymentType: single
services:
Expand Down Expand Up @@ -80,16 +80,6 @@ configs:
type: text
name: Device Prefix

discoveryPortFilter:
dataType: string
targets:
- refVar: CONF_DISCOVERY_PORT_FILTER
services:
- connector
userInput:
type: text
name: Discovery Port Filter

deviceType:
dataType: string
targets:
Expand All @@ -104,7 +94,7 @@ configs:
dataType: string
value: /dev/reader
targets:
- refVar: CONF_DISCOVERY_BASE_PATH
- refVar: CONF_DISCOVERY_FULL_PATH
services:
- connector
userInput:
Expand Down
14 changes: 7 additions & 7 deletions smart_meter/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def run(self) -> None:
if self.__refresh_flag:
self.__refresh_devices()
try:
ports = get_ports()
logger.debug("available ports: {}".format(ports))
active_ports = [device.adapter.source for device in self.__device_pool.values() if device.adapter and type(device.adapter) is SerialAdapter]
logger.debug("active ports {}".format(active_ports))
inactive_ports = list(set(ports) - set(active_ports))
logger.debug("inactive ports {}".format(inactive_ports))
self.__add_devices(probe_ports(inactive_ports))
#ports = get_ports()
#logger.debug("available ports: {}".format(ports))
#active_ports = [device.adapter.source for device in self.__device_pool.values() if device.adapter and type(device.adapter) is SerialAdapter]
#logger.debug("active ports {}".format(active_ports))
#inactive_ports = list(set(ports) - set(active_ports))
#logger.debug("inactive ports {}".format(inactive_ports))
self.__add_devices(probe_ports(conf.Discovery.full_path))
self.__clean_devices()
except Exception as ex:
logger.error("discovery failed - {}".format(ex))
Expand Down
1 change: 1 addition & 0 deletions util/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Discovery:
device_id_prefix = None
base_path = "/dev"
port_filter = None
full_path = None
delay = 15

@simple_env_var.section
Expand Down

0 comments on commit 402e156

Please sign in to comment.