Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/entity_switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ title: Switch Entity
sidebar_label: Switch
---

A switch entity turns on or off something, for example a relay. Derive a platform entity from [`homeassistant.components.switch.SwitchEntity`](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/switch/__init__.py).
To represent something which can be turned on or off but can't be controlled, for example a wall switch which transmits its state but can't be turned on or off from Home Assistant, a Binary Sensor is a better choice.
To represent something which doesn't have a state, for example a door bell push button, a custom event or a Device Trigger is a better choice.

## Properties

:::tip
Expand Down Expand Up @@ -53,7 +57,7 @@ class MySwitch(SwitchDevice):
Optional. If not implemented will default to checking what method to call using the `is_on` property.

```python
class MySwitch(SwitchDevice):
class MySwitch(SwitchEntity):
# Implement one of these methods.

def toggle(self, **kwargs):
Expand Down