1
0
Fork 0

ArmedPartition status text change

This commit is contained in:
Michał Rudowicz 2024-03-05 22:42:03 +01:00
parent f0a16ab443
commit 93b9c0c822
1 changed files with 9 additions and 1 deletions

View File

@ -80,6 +80,14 @@ func getEmojiWhenTrueIsBad(v bool) string {
} }
} }
func getArmedPartitionStatus(v bool) string {
if v {
return "✅ - ARMED"
} else {
return "🔴 - DISARMED"
}
}
func (self SatelMsgContent) FormatEvent() string { func (self SatelMsgContent) FormatEvent() string {
switch self.SatelEvent.Type { switch self.SatelEvent.Type {
case satel.ZoneViolation: case satel.ZoneViolation:
@ -103,7 +111,7 @@ func (self SatelMsgContent) FormatEvent() string {
case satel.ArmedPartitionSuppressed: case satel.ArmedPartitionSuppressed:
return fmt.Sprintf("%s: %t", self.SatelEvent.Type.String(), self.SatelEvent.Value) return fmt.Sprintf("%s: %t", self.SatelEvent.Type.String(), self.SatelEvent.Value)
case satel.ArmedPartition: case satel.ArmedPartition:
return fmt.Sprintf("%s: %s", self.SatelEvent.Type.String(), getEmojiWhenTrueIsGood(self.SatelEvent.Value)) return getArmedPartitionStatus(self.SatelEvent.Value)
case satel.PartitionArmedInMode2: case satel.PartitionArmedInMode2:
return fmt.Sprintf("%s: %t", self.SatelEvent.Type.String(), self.SatelEvent.Value) return fmt.Sprintf("%s: %t", self.SatelEvent.Type.String(), self.SatelEvent.Value)
case satel.PartitionArmedInMode3: case satel.PartitionArmedInMode3: