2018-07-25 12:53:33 -06:00
|
|
|
import { update } from "serializr";
|
|
|
|
|
|
|
|
import * as s from "@common/sprinklersRpc";
|
|
|
|
import * as schema from "@common/sprinklersRpc/schema";
|
|
|
|
|
|
|
|
export class MqttSectionRunner extends s.SectionRunner {
|
2018-09-02 02:57:55 -06:00
|
|
|
onMessage(payload: string) {
|
|
|
|
this.updateFromJSON(JSON.parse(payload));
|
|
|
|
}
|
2018-07-25 12:53:33 -06:00
|
|
|
|
2018-09-02 02:57:55 -06:00
|
|
|
updateFromJSON(json: any) {
|
|
|
|
update(schema.sectionRunner, this, json);
|
|
|
|
}
|
2018-07-25 12:53:33 -06:00
|
|
|
}
|