Skip to content

Commit

Permalink
Fix #297
Browse files Browse the repository at this point in the history
Change split token from - to . for V1.*
  • Loading branch information
BenPru authored Nov 15, 2024
1 parent 8b8817b commit e1781c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/luxtronik/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ def do_request_available_firmware_version(self, download_id: int):
datetime.utcnow().timestamp()
)
# Filename e.g.: wp2reg-V2.88.1-9086
# Extract 'V2.88.1-9086' from 'wp2reg-V2.88.1-9086'.
self.__firmware_version_available = filename.split("-", 1)[1]
# Extract 'V2.88.1-9086' from 'wp2reg-V2.88.1-9086'. --> Split by -
# 'wpreg.V1.88.3-9717' --> Split by .
token = '-' if filename.count('-') > 1 else '.'
self.__firmware_version_available = filename.split(token, 1)[1]
except Exception: # pylint: disable=broad-except
LOGGER.warning(
"Could not request download portal firmware version",
Expand Down

0 comments on commit e1781c4

Please sign in to comment.