This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Open VRChat user in Home Assistant | |
| // @author hi94740 | |
| // @version 1.0.0 | |
| // @description Intended to use with the VRChat integration for Home Assistant. | |
| // @match https://vrchat.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=vrchat.com | |
| // @require https://cdn.jsdelivr.net/npm/lodash@4.18.1/lodash.min.js | |
| // @connect homeassistant.local | |
| // @connect localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: 实体状态变化通知 | |
| description: 当实体状态变化时给移动App发送通知。 | |
| domain: automation | |
| input: | |
| watched_entities: | |
| name: 监控的实体 | |
| description: 选择您想要监控的实体。 | |
| selector: | |
| entity: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copy the function below to use in your scripts. | |
| function createWidget() { | |
| const widget = new ListWidget() | |
| const wrap = (view, isWidget) => { | |
| let wrapped | |
| const wrapWith = (key, exec) => [key, (...args) => (exec(...args), wrapped)] | |
| wrapped = Object.fromEntries(Object.keys(view).map(key => { | |
| if (typeof view[key] === "function") { | |
| if (key.startsWith("add")) return wrapWith(key, (...args) => { | |
| let cb |