Skip to content

Commit

Permalink
MVG_LIVE:
Browse files Browse the repository at this point in the history
- fixed an issue in station_id setting when not using async io with pypi lib
  • Loading branch information
psilo909 committed Oct 13, 2024
1 parent 6909b96 commit 9fd2dd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions mvg_live/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class MVG_Live(SmartPlugin):
ALLOW_MULTIINSTANCE = False
PLUGIN_VERSION = "1.6.0"
PLUGIN_VERSION = "1.6.1"

def __init__(self, sh, *args, **kwargs):
"""
Expand All @@ -42,14 +42,19 @@ def stop(self):
self.alive = False

def get_station(self, station):
mvg_station = MvgApi.station(station)
if mvg_station:
return mvg_station
try:
mvg_station = MvgApi.station(station)
if mvg_station:
return mvg_station
except MvgApiError as e:
self.logger.error("MVGLive: Could not find %s: %s" % (ort, e))

def get_station_departures(self, station):
mvg_station = self.get_station(station)
self.logger.error(mvg_station)
if mvg_station:
mvgapi = MvgApi(mvg_station['id'])
mvgapi.station_id = mvg_station['id']
return mvgapi.departures()
else:
logger.error("Station %s does not exist."%station)
self.logger.error("Station %s does not exist."%station)
4 changes: 2 additions & 2 deletions mvg_live/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ plugin:
documentation: http://smarthomeng.de/user/plugins_doc/config/mvg_live.html
support: https://knx-user-forum.de/forum/supportforen/smarthome-py/1108867-neues-plugin-mvg_live

version: 1.6.0 # Plugin version
sh_minversion: '1.5' # minimum shNG version to use this plugin
version: 1.6.1 # Plugin version
sh_minversion: '1.5' # minimum shNG version to use this plugin
# sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
multi_instance: False # plugin supports multi instance
restartable: unknown
Expand Down

0 comments on commit 9fd2dd6

Please sign in to comment.