Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/hwr/shutter.py: 0%
12 statements
« prev ^ index » next coverage.py v7.6.5, created at 2024-11-15 02:12 +0000
« prev ^ index » next coverage.py v7.6.5, created at 2024-11-15 02:12 +0000
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3from daiquiri.core.hardware.abstract.shutter import Shutter as AbstractShutter
4from daiquiri.core.hardware.hwr.object import HWRObject, HWRProperty
6import logging
8logger = logging.getLogger(__name__)
11class Shutter(HWRObject, AbstractShutter):
12 property_getter_map = {
13 "state": HWRProperty("state", setter="set_state"),
14 "valid": HWRProperty("is_valid"),
15 "open_text": HWRProperty("open_text"),
16 "closed_text": HWRProperty("closed_text"),
17 }
19 CALLABLE_MAP = {"open": "open", "close": "close"}
21 def _call_toggle(self):
22 if self._object.state() == self._object.STATE.OPEN.name:
23 self._object.close()
24 elif self._object.state() == self._object.STATE.CLOSED.name:
25 self._object.open()