This file contains 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: Philips Hue Tap Controller (Optimized) | |
description: Automate actions for each button on a Philips Hue Tap device. | |
domain: automation | |
input: | |
tap_device: | |
name: Philips Hue Tap Device | |
description: Select the Hue Tap device | |
selector: | |
device: |
This file contains 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: Link On/Off State of a Light to Another Light | |
description: | | |
Synchronize the on/off state, brightness, and color settings of a source light to a target light. | |
domain: automation | |
input: | |
source_light: | |
name: Source Light | |
selector: | |
entity: |
This file contains 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: Hue Dimmer Remote Inaki Custom | |
description: | | |
(Dec 2021 Update) Using a Hue bridge with which a dimmer remote is paired, allows you to configure actions based on said Hue Dimmer Remote. | |
NOTE: tested with RWL020 and RWL022, but community says it also works with RWL021! | |
- Cover entity is optional | |
- Long off-press turns brightness to 1% | |
- Long On-press turn brightness up by 33% | |
domain: automation | |
source_url: https://gist.github.com/codycodes/f051781c35cfdfee15162ff680c9cbd8 |
This file contains 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
export const strictCustomEvent = < | |
T extends keyof Omit<DocumentEventMap, defaultDocumentEventNames>, | |
D extends UnpackCustomEventPayload<DocumentEventMap[T]> | |
>( | |
name: T, | |
payload: Omit<CustomEventInit<D>, "detail"> & { | |
detail: D | |
} | |
): CustomEvent<D> => new CustomEvent(name, payload) |
This file contains 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
// https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts#L3307 | |
declare var CustomEvent: { | |
prototype: CustomEvent; | |
new <T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>; | |
}; |
This file contains 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
export const ClassifiedListFilterUpdate = "CL_FILTER_UPDATE"; | |
export type ClassifiedListFilterUpdate = { | |
searchUrls: { | |
/** | |
* Search url with legacy parameters | |
*/ | |
legacy: string; | |
/** | |
* Search url with newer `mmm` parameters | |
*/ |
This file contains 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
// lib.dom.d.ts section | |
// https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts#L4450 | |
addEventListener<K extends keyof DocumentEventMap>( | |
type: K, | |
listener: (this: Document, ev: DocumentEventMap[K]) => any, | |
options?: boolean | AddEventListenerOptions | |
): void; |
This file contains 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
// somewhere in another app... | |
import { ListPage, strictCustomEvent } from "@autoscout24/custom-events"; | |
document.dispatchEvent( | |
strictCustomEvent(ListPage.ClassifiedListTotalCountUpdate, { | |
detail: { | |
totalCount: 42 | |
} | |
}) | |
); |
This file contains 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
// somewhere in your app... | |
import { ListPage } from "@autoscout24/custom-events"; | |
document.addEventListener(ListPage.ClassifiedListFilterUpdate, e => | |
console.log(e.detail.searchUrls.standard) | |
); |
This file contains 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
import * as Redux from "redux"; | |
import Config from "./config"; // some config | |
import { State } from "../../store/rootReducer"; | |
import * as actions from "./actions"; | |
import { listeners as domListeners, mutations as domMutations } from "./dom"; | |
/** | |
* Middleware to schedule dom mutations based on redux actions / state changes | |
*/ | |
export const middleware = (_: Config) => ( |
NewerOlder