From 93b9c0c8225ce6d0fb351d6c8aafcc4db3e34196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Rudowicz?= Date: Tue, 5 Mar 2024 22:42:03 +0100 Subject: [PATCH] ArmedPartition status text change --- message_contents.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/message_contents.go b/message_contents.go index 7c59a62..243dd0e 100644 --- a/message_contents.go +++ b/message_contents.go @@ -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 { switch self.SatelEvent.Type { case satel.ZoneViolation: @@ -103,7 +111,7 @@ func (self SatelMsgContent) FormatEvent() string { case satel.ArmedPartitionSuppressed: return fmt.Sprintf("%s: %t", self.SatelEvent.Type.String(), self.SatelEvent.Value) case satel.ArmedPartition: - return fmt.Sprintf("%s: %s", self.SatelEvent.Type.String(), getEmojiWhenTrueIsGood(self.SatelEvent.Value)) + return getArmedPartitionStatus(self.SatelEvent.Value) case satel.PartitionArmedInMode2: return fmt.Sprintf("%s: %t", self.SatelEvent.Type.String(), self.SatelEvent.Value) case satel.PartitionArmedInMode3: