From 40ea30da96244fa5266ac4fcd09c2f3cc89f72b9 Mon Sep 17 00:00:00 2001
From: Brian Rogers <brg468@hotmail.com>
Date: Thu, 1 Oct 2020 12:19:34 -0400
Subject: [PATCH] Fix Rachio switch state when paused (#40984)

---
 homeassistant/components/rachio/switch.py   | 7 ++++++-
 homeassistant/components/rachio/webhooks.py | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/homeassistant/components/rachio/switch.py b/homeassistant/components/rachio/switch.py
index 32ec6267941..b5dc71b585c 100644
--- a/homeassistant/components/rachio/switch.py
+++ b/homeassistant/components/rachio/switch.py
@@ -56,6 +56,7 @@ from .webhooks import (
     SUBTYPE_SLEEP_MODE_OFF,
     SUBTYPE_SLEEP_MODE_ON,
     SUBTYPE_ZONE_COMPLETED,
+    SUBTYPE_ZONE_PAUSED,
     SUBTYPE_ZONE_STARTED,
     SUBTYPE_ZONE_STOPPED,
 )
@@ -392,7 +393,11 @@ class RachioZone(RachioSwitch):
 
         if args[0][KEY_SUBTYPE] == SUBTYPE_ZONE_STARTED:
             self._state = True
-        elif args[0][KEY_SUBTYPE] in [SUBTYPE_ZONE_STOPPED, SUBTYPE_ZONE_COMPLETED]:
+        elif args[0][KEY_SUBTYPE] in [
+            SUBTYPE_ZONE_STOPPED,
+            SUBTYPE_ZONE_COMPLETED,
+            SUBTYPE_ZONE_PAUSED,
+        ]:
             self._state = False
 
         self.async_write_ha_state()
diff --git a/homeassistant/components/rachio/webhooks.py b/homeassistant/components/rachio/webhooks.py
index 5daf7852725..c175117efcb 100644
--- a/homeassistant/components/rachio/webhooks.py
+++ b/homeassistant/components/rachio/webhooks.py
@@ -58,6 +58,7 @@ SUBTYPE_ZONE_STOPPED = "ZONE_STOPPED"
 SUBTYPE_ZONE_COMPLETED = "ZONE_COMPLETED"
 SUBTYPE_ZONE_CYCLING = "ZONE_CYCLING"
 SUBTYPE_ZONE_CYCLING_COMPLETED = "ZONE_CYCLING_COMPLETED"
+SUBTYPE_ZONE_PAUSED = "ZONE_PAUSED"
 
 # Webhook callbacks
 LISTEN_EVENT_TYPES = [
-- 
GitLab