From 451b976458b7cef740e80349b1e69e58eae4dfd6 Mon Sep 17 00:00:00 2001
From: Franck Nijhof <git@frenck.dev>
Date: Thu, 1 Jul 2021 12:43:37 +0200
Subject: [PATCH] Demo: Explicitly return None when no extra state attribute
 set (#52390)

---
 homeassistant/components/demo/remote.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/homeassistant/components/demo/remote.py b/homeassistant/components/demo/remote.py
index 1badd391575..c8e54aa65f3 100644
--- a/homeassistant/components/demo/remote.py
+++ b/homeassistant/components/demo/remote.py
@@ -53,6 +53,7 @@ class DemoRemote(RemoteEntity):
         """Return device state attributes."""
         if self._last_command_sent is not None:
             return {"last_command_sent": self._last_command_sent}
+        return None
 
     def turn_on(self, **kwargs: Any) -> None:
         """Turn the remote on."""