From 1117fd9b81c256764937713dd70db238f2d72597 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sun, 16 May 2021 02:01:38 +0300 Subject: format(): support Format(Enum) as an argument --- inverterd/inverterd.py | 6 ++++-- setup.cfg | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/inverterd/inverterd.py b/inverterd/inverterd.py index 5b9541e..b2814d5 100644 --- a/inverterd/inverterd.py +++ b/inverterd/inverterd.py @@ -45,8 +45,10 @@ class Client: self._write(f'v {v}') return self._read() - def format(self, format): - self._write(f'format {format}') + def format(self, fmt): + if isinstance(fmt, Format): + fmt = fmt.value + self._write(f'format {fmt}') return self._read() def exec(self, command, arguments=()): diff --git a/setup.cfg b/setup.cfg index e27b57d..1416a3c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = inverterd -version = 1.0.1 +version = 1.0.2 author = Evgeny Zinoviev author_email = me@ch1p.io description = -- cgit v1.2.3