Fix minor eslint warnings
This commit is contained in:
parent
8917402888
commit
43a33c3ab3
7 changed files with 11 additions and 11 deletions
|
|
@ -633,7 +633,7 @@ const config: Config = {
|
|||
position: [1413, 500],
|
||||
icon: mdi("pool"),
|
||||
iconColor: ({whirlpoolBubbles}) =>
|
||||
(parseInt(whirlpoolBubbles) > 0 ? hex("#00ff00") : hex("#000000")),
|
||||
(parseInt(whirlpoolBubbles, 10) > 0 ? hex("#00ff00") : hex("#000000")),
|
||||
ui: [
|
||||
{
|
||||
type: "text",
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ import { renderRawIcon } from "config/icon";
|
|||
import type { Icon } from "config/icon";
|
||||
|
||||
export type Helpers = {
|
||||
Icon: (props: Object) => React.Node,
|
||||
Label: (props: Object) => React.Node,
|
||||
Action: (props: Object) => React.Node
|
||||
Icon: (props: { item: { +icon?: Icon }, state: State }) => React.Node,
|
||||
Label: (props: {}) => React.Node,
|
||||
Action: (props: {}) => React.Node
|
||||
};
|
||||
|
||||
export type BaseComponent<T> = (
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@ import Link from "./Link";
|
|||
import Slider from "./Slider";
|
||||
import Text from "./Text";
|
||||
import Progress from "./Progress";
|
||||
import * as React from "react";
|
||||
|
||||
import type { ControlUI } from "config/flowtypes";
|
||||
|
||||
const Control = ({item}: {item: ControlUI}) => {
|
||||
const Control = ({item}: {item: ControlUI}): React.Node => {
|
||||
switch (item.type) {
|
||||
case "toggle": {
|
||||
return Toggle.component(item);
|
||||
|
|
|
|||
|
|
@ -35,9 +35,8 @@ export const mdiBattery = (topic: string) => (state: State) => {
|
|||
return rawMdi("battery-30");
|
||||
} else if (val > 15) {
|
||||
return rawMdi("battery-20");
|
||||
} else {
|
||||
return rawMdi("battery-10");
|
||||
}
|
||||
return rawMdi("battery-10");
|
||||
};
|
||||
|
||||
export const renderRawIcon =
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export const option = (values: TypeOptionParam): TopicType => {
|
|||
return values.otherwise;
|
||||
} else {
|
||||
throw new Error(
|
||||
`Value ${x.toString()} cannot by mapped by the option parameters given`
|
||||
`Value ${x.toString()} cannot be mapped by the option parameters given`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ export default function connectMqtt(
|
|||
}
|
||||
});
|
||||
return (topic: string, message: Buffer) => {
|
||||
client.publish(topic, message, null, (error) => {
|
||||
client.publish(topic, message, {}, (error) => {
|
||||
if (error == null && settings.onMessageSent != null) {
|
||||
settings.onMessageSent(topic, message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ import React from "react";
|
|||
|
||||
export type MqttContextValue = {
|
||||
state: State,
|
||||
changeState: (topic: string, value: string) => void
|
||||
changeState: (topic: string, value: string) => State
|
||||
};
|
||||
|
||||
export default React.createContext({
|
||||
state: {},
|
||||
changeState: (_topic, _val) => {}
|
||||
changeState: (_topic, _val) => ({})
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue