mirror of
https://github.com/mtan93/homebridge.git
synced 2026-04-16 22:05:15 +01:00
HA switch takes a type argument
This lets you pass the domain to the switch to let it be other types of objects, like say, a scene.
This commit is contained in:
@@ -399,9 +399,9 @@ HomeAssistantMediaPlayer.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function HomeAssistantSwitch(log, data, client) {
|
function HomeAssistantSwitch(log, data, client, type) {
|
||||||
// device info
|
// device info
|
||||||
this.domain = "switch"
|
this.domain = type || "switch"
|
||||||
this.data = data
|
this.data = data
|
||||||
this.entity_id = data.entity_id
|
this.entity_id = data.entity_id
|
||||||
if (data.attributes && data.attributes.friendly_name) {
|
if (data.attributes && data.attributes.friendly_name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user