summaryrefslogtreecommitdiff
path: root/inverterd
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-05-16 02:01:38 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-05-16 02:01:45 +0300
commit1117fd9b81c256764937713dd70db238f2d72597 (patch)
tree8a176ca5ff44ee12b805805b2a06d59cc3e75d12 /inverterd
parentc9edd6717283a4bf11bdda91e95b70590ac84a2f (diff)
format(): support Format(Enum) as an argument
Diffstat (limited to 'inverterd')
-rw-r--r--inverterd/inverterd.py6
1 files changed, 4 insertions, 2 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=()):