Add speaker

This commit is contained in:
Ranlvor 2019-05-24 19:09:36 +02:00
parent a92c57c58d
commit 92b63a7d01
Signed by untrusted user who does not match committer: Ranlvor
GPG key ID: 5E12D04750EF6F8E

View file

@ -1,7 +1,7 @@
// @flow
import type { Config } from "config/flowtypes";
import * as types from "config/types";
import { mdi } from "config/icon";
import { mdi, rawMdi } from "config/icon";
import { hex } from "config/colors";
const topicBulb = (bulb: string, argument: string) => ({
@ -131,7 +131,8 @@ const config: Config = {
},
defaultValue: "OFF"
},
...topicHomeBoolean("livingroomKodiControlled", "bulb/livingroom/kodi-controlled"),
...topicHomeBoolean("livingroomKodiControlled",
"bulb/livingroom/kodi-controlled"),
...topicHomeBoolean("bedroomWakeup", "wakeup"),
bedroomBrightness: {
state: {
@ -197,7 +198,8 @@ const config: Config = {
type: (value) => JSON.stringify({ state: value.toString() })
},
defaultValue: "OFF"
}
},
...topicTasmota("speakerOffice", "sonoff-office-speaker")
}
],
controls: {
@ -257,6 +259,22 @@ const config: Config = {
}
]
},
officeSpeaker: {
name: "Lautsprecher",
position: [550, 400],
icon: ({speakerOfficeState}) =>
(speakerOfficeState === "on" ? rawMdi("volume-high") : rawMdi("volume-off")),
iconColor: ({speakerOfficeState}) =>
(speakerOfficeState === "on" ? hex("#00FF00") : hex("#000000")),
ui: [
{
type: "toggle",
topic: "speakerOfficeState",
text: "Ein/Ausschalten",
icon: mdi("power")
}
]
},
officeFan: {
name: "Lüftung Büro",
position: [600, 400],