Merge remote-tracking branch 'upstream/master' into patch-13
This commit is contained in:
commit
b868156deb
24 changed files with 1145 additions and 1940 deletions
|
|
@ -1,6 +1,8 @@
|
|||
// @flow
|
||||
import type { Config } from "config/flowtypes";
|
||||
import { hex, rgb, rgba, rainbow } from "config/colors";
|
||||
import * as types from "config/types";
|
||||
import { mdi } from "config/icon";
|
||||
import { esper_topics, esper_statistics } from "./utils";
|
||||
|
||||
const config : Config = {
|
||||
|
|
@ -12,16 +14,18 @@ const config : Config = {
|
|||
topics: [
|
||||
{
|
||||
hauptraum_table_light: {
|
||||
command: "/public/sensoren/TPH/leinwand/control",
|
||||
state: "test",
|
||||
defaultValue: "A1 ON",
|
||||
values: { on: "A1 ON", off: "A1 OFF" }
|
||||
command: {
|
||||
name: "/public/sensoren/TPH/leinwand/control",
|
||||
type: types.option({ "A1 ON": "on", "A1 OFF": "off" })
|
||||
},
|
||||
defaultValue: "off"
|
||||
},
|
||||
hauptraum_table_light_on_hack: {
|
||||
command: "/public/sensoren/TPH/leinwand/control",
|
||||
state: "test",
|
||||
defaultValue: "A1 OFF",
|
||||
values: { on: "A1 ON", off: "A1 OFF" }
|
||||
command: {
|
||||
name: "/public/sensoren/TPH/leinwand/control",
|
||||
type: types.option({ "A1 ON": "on", "A1 OFF": "off" })
|
||||
},
|
||||
defaultValue: "on"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
@ -29,20 +33,20 @@ const config : Config = {
|
|||
hauptraum_table_light: {
|
||||
name: "Hauptraum Tisch",
|
||||
position: [450, 450],
|
||||
icon: "white-balance-iridescent",
|
||||
icon: mdi("white-balance-iridescent"),
|
||||
iconColor: () => hex("#000000"),
|
||||
ui: [
|
||||
{
|
||||
type: "toggle",
|
||||
text: "Licht",
|
||||
topic: "hauptraum_table_light",
|
||||
icon: "power"
|
||||
icon: mdi("power")
|
||||
},
|
||||
{
|
||||
type: "toggle",
|
||||
text: "Licht",
|
||||
topic: "hauptraum_table_light_on_hack",
|
||||
icon: "power"
|
||||
icon: mdi("power")
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
731
config/rzl.js
731
config/rzl.js
File diff suppressed because it is too large
Load diff
111
config/utils.js
111
config/utils.js
|
|
@ -1,42 +1,44 @@
|
|||
// @flow
|
||||
import type { ControlUI } from "config/flowtypes";
|
||||
import { mdi } from "config/icon";
|
||||
import * as types from "config/types";
|
||||
|
||||
export const esper_topics = (chip_id: string, name: string) => ({
|
||||
[ `esper_${name}_version` ]: {
|
||||
state: `/service/esper/${chip_id}/info`,
|
||||
command: "",
|
||||
defaultValue: "UNKNOWN",
|
||||
values: {},
|
||||
type: msg => JSON.parse(msg.toString()).version.esper
|
||||
state: {
|
||||
name: `/service/esper/${chip_id}/info`,
|
||||
type: types.json("version.esper")
|
||||
},
|
||||
defaultValue: "UNKNOWN"
|
||||
},
|
||||
[ `esper_${name}_ip` ]: {
|
||||
state: `/service/esper/${chip_id}/info`,
|
||||
command: "",
|
||||
defaultValue: "UNKNOWN",
|
||||
values: {},
|
||||
type: msg => JSON.parse(msg.toString()).network.ip
|
||||
state: {
|
||||
name: `/service/esper/${chip_id}/info`,
|
||||
type: types.json("network.ip")
|
||||
},
|
||||
defaultValue: "UNKNOWN"
|
||||
},
|
||||
[ `esper_${name}_rssi` ]: {
|
||||
state: `/service/esper/${chip_id}/info`,
|
||||
command: "",
|
||||
defaultValue: "UNKNOWN",
|
||||
values: {},
|
||||
type: msg => JSON.parse(msg.toString()).wifi.rssi
|
||||
state: {
|
||||
name: `/service/esper/${chip_id}/info`,
|
||||
type: types.json("wifi.rssi")
|
||||
},
|
||||
defaultValue: "UNKNOWN"
|
||||
},
|
||||
[ `esper_${name}_uptime` ]: {
|
||||
state: `/service/esper/${chip_id}/info`,
|
||||
command: "",
|
||||
defaultValue: "UNKNOWN",
|
||||
values: {},
|
||||
type: msg => new Date(JSON.parse(msg.toString()).time.startup * 1000)
|
||||
state: {
|
||||
name: `/service/esper/${chip_id}/info`,
|
||||
type: msg => new Date(JSON.parse(msg.toString()).time.startup * 1000)
|
||||
.toLocaleString()
|
||||
},
|
||||
defaultValue: "UNKNOWN",
|
||||
},
|
||||
[ `esper_${name}_device` ]: {
|
||||
state: `/service/esper/${chip_id}/info`,
|
||||
command: "",
|
||||
defaultValue: "UNKNOWN",
|
||||
values: {},
|
||||
type: msg => JSON.parse(msg.toString()).device
|
||||
state: {
|
||||
name: `/service/esper/${chip_id}/info`,
|
||||
type: types.json("device")
|
||||
},
|
||||
defaultValue: "UNKNOWN"
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -45,22 +47,53 @@ export const floalt = {
|
|||
brightness: (light_id: string) => `floalt_${light_id}_brightness`,
|
||||
topics: (light_id: string) => ({
|
||||
[ `floalt_${light_id}_color` ]: {
|
||||
state: `/service/openhab/out/tradfri_0220_gwb8d7af2b448f_${light_id}_color_temperature/state`,
|
||||
command: `/service/openhab/in/tradfri_0220_gwb8d7af2b448f_${light_id}_color_temperature/command`,
|
||||
defaultValue: "0",
|
||||
values: {}
|
||||
state: {
|
||||
name: `/service/openhab/out/tradfri_0220_gwb8d7af2b448f_${light_id}_color_temperature/state`,
|
||||
type: types.string
|
||||
},
|
||||
command: {
|
||||
name: `/service/openhab/in/tradfri_0220_gwb8d7af2b448f_${light_id}_color_temperature/command`,
|
||||
type: types.string
|
||||
},
|
||||
defaultValue: "0"
|
||||
},
|
||||
[ `floalt_${light_id}_brightness` ]: {
|
||||
state: `/service/openhab/out/tradfri_0220_gwb8d7af2b448f_${light_id}_brightness/state`,
|
||||
command: `/service/openhab/in/tradfri_0220_gwb8d7af2b448f_${light_id}_brightness/command`,
|
||||
defaultValue: "0",
|
||||
values: {}
|
||||
state: {
|
||||
name: `/service/openhab/out/tradfri_0220_gwb8d7af2b448f_${light_id}_brightness/state`,
|
||||
type: types.string
|
||||
},
|
||||
command: {
|
||||
name: `/service/openhab/in/tradfri_0220_gwb8d7af2b448f_${light_id}_brightness/command`,
|
||||
type: types.string
|
||||
},
|
||||
defaultValue: "0"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const tradfri_remote = {
|
||||
level: (remote_id: string) => `tradfri_remote_${remote_id}_level`,
|
||||
low: (remote_id: string) => `tradfri_remote_${remote_id}_low`,
|
||||
topics: (remote_id: string) => ({
|
||||
[ `tradfri_remote_${remote_id}_level` ]: {
|
||||
state: {
|
||||
name: `/service/openhab/out/tradfri_0830_gwb8d7af2b448f_${remote_id}_battery_level/state`,
|
||||
type: types.string
|
||||
},
|
||||
defaultValue: "0"
|
||||
},
|
||||
[ `tradfri_remote_${remote_id}_low` ]: {
|
||||
state: {
|
||||
name: `/service/openhab/out/tradfri_0830_gwb8d7af2b448f_${remote_id}_battery_low/state`,
|
||||
type: types.option({ ON: "true", OFF: "false" })
|
||||
},
|
||||
defaultValue: "false",
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const esper_statistics = (name: string,
|
||||
prev_ui: Array<ControlUI> = []) => (
|
||||
prev_ui: Array<ControlUI> = []): Array<ControlUI> => (
|
||||
prev_ui.concat([
|
||||
{
|
||||
type: "section",
|
||||
|
|
@ -69,31 +102,31 @@ export const esper_statistics = (name: string,
|
|||
{
|
||||
type: "text",
|
||||
text: "Device Variant",
|
||||
icon: "chart-donut",
|
||||
icon: mdi("chart-donut"),
|
||||
topic: `esper_${name}_device`
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
text: "Version",
|
||||
icon: "source-branch",
|
||||
icon: mdi("source-branch"),
|
||||
topic: `esper_${name}_version`
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
text: "IP",
|
||||
icon: "access-point-network",
|
||||
icon: mdi("access-point-network"),
|
||||
topic: `esper_${name}_ip`
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
text: "RSSI",
|
||||
icon: "wifi",
|
||||
icon: mdi("wifi"),
|
||||
topic: `esper_${name}_rssi`
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
text: "Running since…",
|
||||
icon: "av-timer",
|
||||
icon: mdi("av-timer"),
|
||||
topic: `esper_${name}_uptime`
|
||||
}
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue