Skip to content

Commit

Permalink
TangoShutter: fix docstrings
Browse files Browse the repository at this point in the history
Also changed type hint for `TangoShutter._update_value`.
The value could possibly be a string (i.e. using `TangoChannel` with
`read_as_str` set to True).
  • Loading branch information
mockoocy committed Feb 25, 2025
1 parent ea09fd4 commit 167fd15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mxcubecore/HardwareObjects/TangoShutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def init(self) -> None:
self.state_channel.connect_signal("update", self._update_value)
self.update_state()

def _update_value(self, value: DevState) -> None:
def _update_value(self, value: DevState | str) -> None:
"""Update the value.
Args:
value: The value reported by the state channel.
Expand Down Expand Up @@ -138,7 +138,7 @@ def _initialise_values(self) -> None:
def get_state(self) -> HardwareObjectState:
"""Get the device state.
Returns:
(enum 'HardwareObjectState'): Device state.
Device state.
"""
try:
_state = self.get_value().name
Expand All @@ -150,7 +150,7 @@ def get_state(self) -> HardwareObjectState:
def get_value(self) -> TangoShutterStates:
"""Get the device value
Returns:
(Enum): Enum member, corresponding to the 'VALUE' or UNKNOWN.
Enum member, corresponding to the 'VALUE' or UNKNOWN.
"""
_val = str(self.state_channel.get_value())
return self.value_to_enum(_val)
Expand Down

0 comments on commit 167fd15

Please sign in to comment.