Repository: craigjmidwinter/total-connect-client

Issue:
unknown ArmingState 10230
Initially reported at https://github.com/home-assistant/core/issues/64303

```txt
unknown ArmingState 10230 in OrderedDict([('PartitionID', 1), ('ArmingState', 10230), ('IsAlarmResponded', False), ('AlarmTriggerTimeLocalized', None), ('PartitionName', 'Main'), ('IsStayArmed', False), ('IsFireEnabled', False), ('IsCommonEnabled', False), ('IsLocked', False), ('IsNewPartition', False), ('IsNightStayEnabled', 0), ('ExitDelayTimer', 0)]);
```

Discussion:

Patch:
diff --git a/total_connect_client/const.py b/total_connect_client/const.py
index a927fc8..ea43e74 100644
--- a/total_connect_client/const.py
+++ b/total_connect_client/const.py
@@ -22,6 +22,7 @@ class ArmingState(Enum):
     ARMED_AWAY_BYPASS = 10202
     ARMED_STAY = 10203
     ARMED_STAY_OTHER = 10226
+    ARMED_STAY_10230 = 10230    # issue #173
     ARMED_STAY_BYPASS = 10204
     ARMED_AWAY_INSTANT = 10205
     ARMED_AWAY_INSTANT_BYPASS = 10206
@@ -77,6 +78,7 @@ class ArmingState(Enum):
             ArmingState.ARMED_STAY_INSTANT_BYPASS,
             ArmingState.ARMED_STAY_NIGHT,
             ArmingState.ARMED_STAY_OTHER,
+            ArmingState.ARMED_STAY_10230,
         )
 
     def is_armed_night(self):
diff --git a/total_connect_client/location.py b/total_connect_client/location.py
index 878329a..891348e 100644
--- a/total_connect_client/location.py
+++ b/total_connect_client/location.py
@@ -277,9 +277,9 @@ class TotalConnectLocation:
             self.arming_state = ArmingState(astate)
         except ValueError:
             LOGGER.error(
-                f"unknown ArmingState {astate} in {result}: please report at {PROJECT_URL}/issues"
+                f"unknown location ArmingState {astate} in {result}: please report at {PROJECT_URL}/issues"
             )
-            raise TotalConnectError(f"unknown ArmingState {astate} in {result}") from None
+            raise TotalConnectError(f"unknown location ArmingState {astate} in {result}") from None
 
     def _update_partitions(self, result):
         """Update partition info from Partitions."""
diff --git a/total_connect_client/partition.py b/total_connect_client/partition.py
index 446544d..0c1b121 100644
--- a/total_connect_client/partition.py
+++ b/total_connect_client/partition.py
@@ -54,5 +54,5 @@ class TotalConnectPartition:
         try:
             self.arming_state = ArmingState(astate)
         except ValueError:
-            LOGGER.error(f"unknown ArmingState {astate} in {info}: report at {PROJECT_URL}/issues")
-            raise TotalConnectError(f"unknown ArmingState {astate} in {info}") from None
+            LOGGER.error(f"unknown partition ArmingState {astate} in {info}: report at {PROJECT_URL}/issues")
+            raise TotalConnectError(f"unknown partition ArmingState {astate} in {info}") from None


Test patch:
diff --git a/tests/const.py b/tests/const.py
index c0f53c9..0bb1d3f 100644
--- a/tests/const.py
+++ b/tests/const.py
@@ -135,6 +135,12 @@ PARTITION_ARMED_AWAY = {
     "ArmingState": ArmingState.ARMED_AWAY.value,
 }
 
+PARTITION_ARMED_STAY_10230 = {
+    "PartitionID": 1,
+    "ArmingState": 10230,
+    "PartitionName": "Test_10230",
+}
+
 PARTITION_INFO_DISARMED = [PARTITION_DISARMED, PARTITION_DISARMED2]
 
 PARTITION_INFO_ARMED_STAY = [PARTITION_ARMED_STAY]
diff --git a/tests/test_partition.py b/tests/test_partition.py
index b67e729..b2dfcb8 100644
--- a/tests/test_partition.py
+++ b/tests/test_partition.py
@@ -4,7 +4,7 @@ from copy import deepcopy
 from unittest.mock import Mock
 
 import pytest
-from const import PARTITION_DETAILS_1, PARTITION_DISARMED
+from const import PARTITION_ARMED_STAY_10230, PARTITION_DETAILS_1, PARTITION_DISARMED
 
 from total_connect_client.client import ArmingHelper
 from total_connect_client.exceptions import PartialResponseError, TotalConnectError
@@ -77,3 +77,8 @@ def tests_arming_state():
     assert partition.arming_state.is_triggered_fire() is False
     assert partition.arming_state.is_triggered_gas() is False
     assert partition.arming_state.is_triggered() is False
+
+    # test recreates issue #173
+    partition = TotalConnectPartition(PARTITION_ARMED_STAY_10230, None)
+    assert partition.arming_state.is_armed_home() is True
+    
\ No newline at end of file