From 880e00d8f111d50c41b174567d0a85763dddaea6 Mon Sep 17 00:00:00 2001 From: Matthias Alphart Date: Wed, 14 Apr 2021 17:33:44 +0200 Subject: [PATCH] use `SwitchEntity` in example (#887) instead of deprecated SwitchDevice --- docs/core/entity.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/core/entity.md b/docs/core/entity.md index ed35d444..03c96525 100644 --- a/docs/core/entity.md +++ b/docs/core/entity.md @@ -12,16 +12,16 @@ For a generic introduction of entities, see [entities architecture](../architect Below is an example switch entity that keeps track of their state in memory. ```python -from homeassistant.components.switch import SwitchDevice +from homeassistant.components.switch import SwitchEntity -class MySwitch(SwitchDevice): +class MySwitch(SwitchEntity): def __init__(self): self._is_on = False @property def name(self): - """Name of the device.""" + """Name of the entity.""" return "My Switch" @property