Skip to content

Commit

Permalink
Add rain sensor alarm and count to safety group
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jun 25, 2024
1 parent dc0e2a3 commit 111e060
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/lvmecp/etc/lvmecp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ modbus:
address: 601
mode: coil
group: safety
rain_sensor_alarm:
address: 699
mode: coil
group: safety
rain_sensor_count:
address: 699
mode: holding_register
group: safety

safety:
override_local_mode: False
Expand Down
1 change: 1 addition & 0 deletions python/lvmecp/maskbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class SafetyStatus(Maskbit):
O2_SENSOR_UR_FAULT = 0x200
O2_SENSOR_SR_ALARM = 0x400 # Spec room
O2_SENSOR_SR_FAULT = 0x800
RAIN_SENSOR_ALARM = 0x1000
UNKNOWN = 0x100000


Expand Down
4 changes: 4 additions & 0 deletions python/lvmecp/safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ async def _update_internal(self, use_cache: bool = True):
if safety_status.oxygen_mode_spectrograph_room == 8:
new_status |= self.flag.O2_SENSOR_SR_FAULT

# Rain sensor
if safety_status.rain_sensor_alarm:
new_status |= self.flag.RAIN_SENSOR_ALARM

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

Expand Down

0 comments on commit 111e060

Please sign in to comment.