Add Fan beedroom

This commit is contained in:
Ranlvor 2019-05-13 22:29:52 +02:00
parent ae28480968
commit fa03e0061f
Signed by untrusted user who does not match committer: Ranlvor
GPG key ID: 5E12D04750EF6F8E

View file

@ -2,6 +2,7 @@
import type { Config } from "config/flowtypes"; import type { Config } from "config/flowtypes";
import * as types from "config/types"; import * as types from "config/types";
import { mdi } from "config/icon"; import { mdi } from "config/icon";
import { hex } from "config/colors";
const topicBulb = (bulb: string, argument: string) => ({ const topicBulb = (bulb: string, argument: string) => ({
[`${bulb}${argument}`]: { [`${bulb}${argument}`]: {
@ -157,6 +158,31 @@ const config: Config = {
}, },
defaultValue: "OFF" defaultValue: "OFF"
}, },
fanBedroomState: {
state: {
name: "stat/sonoff-bedroom-fan/POWER",
type: types.option({
OFF: "off",
ON: "on"
})
},
command: {
name: "cmnd/sonoff-bedroom-fan/POWER",
type: types.string
},
defaultValue: "OFF"
},
fanBedroomAuto: {
state: {
name: "home-rust/temperature-control/bedroom",
type: types.option({ true: "on", false: "off" })
},
command: {
name: "home-rust/temperature-control/bedroom/set",
type: types.option({ on: "true", off: "false" })
},
defaultValue: "OFF"
},
hallwayBrightness: { hallwayBrightness: {
state: { state: {
name: "home-rust/bulb/hallway/brightness", name: "home-rust/bulb/hallway/brightness",
@ -220,6 +246,27 @@ const config: Config = {
} }
] ]
}, },
bedroomFan: {
name: "Lüftung Schlafzimmer",
position: [200, 400],
icon: mdi("fan"),
iconColor: ({fanBedroomState}) =>
(fanBedroomState === "on" ? hex("#00FF00") : hex("#000000")),
ui: [
{
type: "toggle",
topic: "fanBedroomState",
text: "Ein/Ausschalten",
icon: mdi("power")
},
{
type: "toggle",
topic: "fanBedroomAuto",
text: "Automatik",
icon: mdi("air-conditioner")
}
]
},
hallwayLight: { hallwayLight: {
name: "Flur", name: "Flur",
position: [500, 200], position: [500, 200],