Add version command

This commit is contained in:
Torjus Håkestad 2024-06-15 11:39:19 +02:00
parent 5c12b69409
commit 365b2d6857
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import importlib.metadata
import os
from enum import Enum
from typing import NamedTuple
@ -173,6 +174,14 @@ def set_brightness(
payload = json.dumps({"brightness": brightness})
pub.single(topic, payload, hostname=get_mqtt_broker())
@app.command()
def version():
"""
Print huecli version
"""
version = importlib.metadata.version("huecli")
typer.echo(f"huecli {version}")
def parse_color(color: str) -> XYColor:
if color in COLOR_MAP:
return XYColor(COLOR_MAP[color][0], COLOR_MAP[color][1])

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "huecli"
version = "0.1.1"
version = "0.1.2"
description = "Set Philips Hue lights using MQTT"
authors = ["Torjus Håkestad <torjus@uio.no>"]
license = "MIT"