diff --git a/custom_components/tapo_control/camera.py b/custom_components/tapo_control/camera.py index 0745334..314bb26 100644 --- a/custom_components/tapo_control/camera.py +++ b/custom_components/tapo_control/camera.py @@ -197,11 +197,36 @@ def updateTapo(self, camData): self._attr_extra_state_attributes[attr] = value self._attr_extra_state_attributes["alarm"] = camData["alarm"] self._attr_extra_state_attributes["user"] = camData["user"] - self._attr_extra_state_attributes["presets"] = camData["presets"] # Disable incorrect location report by camera self._attr_extra_state_attributes["longitude"] = 0 self._attr_extra_state_attributes["latitude"] = 0 self._attr_extra_state_attributes["has_set_location_info"] = 0 + # lists below + self._attr_extra_state_attributes["presets"] = camData["presets"] + if camData["recordPlan"]: + self._attr_extra_state_attributes["record_plan"] = { + "sunday": camData["recordPlan"]["sunday"] + if "sunday" in camData["recordPlan"] + else None, + "monday": camData["recordPlan"]["monday"] + if "monday" in camData["recordPlan"] + else None, + "tuesday": camData["recordPlan"]["tuesday"] + if "tuesday" in camData["recordPlan"] + else None, + "wednesday": camData["recordPlan"]["wednesday"] + if "wednesday" in camData["recordPlan"] + else None, + "thursday": camData["recordPlan"]["thursday"] + if "thursday" in camData["recordPlan"] + else None, + "friday": camData["recordPlan"]["friday"] + if "friday" in camData["recordPlan"] + else None, + "saturday": camData["recordPlan"]["saturday"] + if "saturday" in camData["recordPlan"] + else None, + } async def async_enable_motion_detection(self): await self.hass.async_add_executor_job(