Add unique_id to the example of mqtt switch (#13295)

I was surprised that I cannot define the Id of the created switch, it is difficult to use it in automation without an id. It turns out that there is `unique_id` parameter, so why not show it to the world?
This commit is contained in:
Artur 'Wodor' Wielogorski 2020-06-01 19:54:29 +01:00 committed by GitHub
parent fc1d2291f3
commit aefc4429d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,6 +159,7 @@ The example below shows a full configuration for a switch.
# Example configuration.yaml entry
switch:
- platform: mqtt
unique_id: bedroom_switch
name: "Bedroom Switch"
state_topic: "home/bedroom/switch1"
command_topic: "home/bedroom/switch1/set"