Fix minor eslint warnings

This commit is contained in:
uwap 2020-10-05 22:02:30 +02:00
parent 8917402888
commit 43a33c3ab3
7 changed files with 11 additions and 11 deletions

View file

@ -633,7 +633,7 @@ const config: Config = {
position: [1413, 500], position: [1413, 500],
icon: mdi("pool"), icon: mdi("pool"),
iconColor: ({whirlpoolBubbles}) => iconColor: ({whirlpoolBubbles}) =>
(parseInt(whirlpoolBubbles) > 0 ? hex("#00ff00") : hex("#000000")), (parseInt(whirlpoolBubbles, 10) > 0 ? hex("#00ff00") : hex("#000000")),
ui: [ ui: [
{ {
type: "text", type: "text",

View file

@ -11,9 +11,9 @@ import { renderRawIcon } from "config/icon";
import type { Icon } from "config/icon"; import type { Icon } from "config/icon";
export type Helpers = { export type Helpers = {
Icon: (props: Object) => React.Node, Icon: (props: { item: { +icon?: Icon }, state: State }) => React.Node,
Label: (props: Object) => React.Node, Label: (props: {}) => React.Node,
Action: (props: Object) => React.Node Action: (props: {}) => React.Node
}; };
export type BaseComponent<T> = ( export type BaseComponent<T> = (

View file

@ -6,10 +6,11 @@ import Link from "./Link";
import Slider from "./Slider"; import Slider from "./Slider";
import Text from "./Text"; import Text from "./Text";
import Progress from "./Progress"; import Progress from "./Progress";
import * as React from "react";
import type { ControlUI } from "config/flowtypes"; import type { ControlUI } from "config/flowtypes";
const Control = ({item}: {item: ControlUI}) => { const Control = ({item}: {item: ControlUI}): React.Node => {
switch (item.type) { switch (item.type) {
case "toggle": { case "toggle": {
return Toggle.component(item); return Toggle.component(item);

View file

@ -35,9 +35,8 @@ export const mdiBattery = (topic: string) => (state: State) => {
return rawMdi("battery-30"); return rawMdi("battery-30");
} else if (val > 15) { } else if (val > 15) {
return rawMdi("battery-20"); return rawMdi("battery-20");
} else {
return rawMdi("battery-10");
} }
return rawMdi("battery-10");
}; };
export const renderRawIcon = export const renderRawIcon =

View file

@ -17,7 +17,7 @@ export const option = (values: TypeOptionParam): TopicType => {
return values.otherwise; return values.otherwise;
} else { } else {
throw new Error( 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`
); );
} }
}; };

View file

@ -49,7 +49,7 @@ export default function connectMqtt(
} }
}); });
return (topic: string, message: Buffer) => { return (topic: string, message: Buffer) => {
client.publish(topic, message, null, (error) => { client.publish(topic, message, {}, (error) => {
if (error == null && settings.onMessageSent != null) { if (error == null && settings.onMessageSent != null) {
settings.onMessageSent(topic, message); settings.onMessageSent(topic, message);
} }

View file

@ -3,10 +3,10 @@ import React from "react";
export type MqttContextValue = { export type MqttContextValue = {
state: State, state: State,
changeState: (topic: string, value: string) => void changeState: (topic: string, value: string) => State
}; };
export default React.createContext({ export default React.createContext({
state: {}, state: {},
changeState: (_topic, _val) => {} changeState: (_topic, _val) => ({})
}); });