Skip to content

Commit

Permalink
Do not always set UNKNOWN if flag is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Aug 31, 2023
1 parent d8c0226 commit e38b905
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions python/lvmecp/dome.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ async def _update_internal(self):
else:
new_status |= self.flag.POSITION_UNKNOWN

if new_status.value == 0:
new_status = self.flag.__unknown__

return new_status

async def set_direction(self, open: bool):
Expand Down
3 changes: 0 additions & 3 deletions python/lvmecp/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ async def update(self):
log.warning(f"{self.name}: failed updating status: {err}")
new_status = self.flag(self.flag.__unknown__)

if new_status.value == 0:
new_status = self.flag(self.flag.__unknown__)

# Only notify if the status has changed.
if new_status != self.status:
await self.notify_status(new_status)
Expand Down
3 changes: 3 additions & 0 deletions python/lvmecp/safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ async def _update_internal(self):
if safety_status.local:
new_status |= self.flag.LOCAL

if new_status.value == 0:
new_status = self.flag.__unknown__

return new_status

async def is_remote(self):
Expand Down

0 comments on commit e38b905

Please sign in to comment.