diff --git a/Libraries/Python3/pineapple/helpers/helpers.py b/Libraries/Python3/pineapple/helpers/helpers.py index 00e65d7..4b752a6 100644 --- a/Libraries/Python3/pineapple/helpers/helpers.py +++ b/Libraries/Python3/pineapple/helpers/helpers.py @@ -1,4 +1,5 @@ import json +from typing import Tuple def json_to_bytes(message) -> bytes: @@ -14,3 +15,14 @@ def json_to_bytes(message) -> bytes: d = json.dumps(message) return d.encode('utf-8') + + +def get_version() -> Tuple[str, str]: + """ + Get the system firmware version. + :return: tuple containing version and build number + """ + + with open('/etc/pineapple/version', 'r') as f: + vers = [l.strip() for l in f.readlines()] + return vers[0], vers[1]