import React from 'react'; import { ValidatorForm, TextValidator, SelectValidator } from 'react-material-ui-form-validator'; import { Checkbox, Typography, Box, Link, withWidth, WithWidthProps } from '@material-ui/core'; import SaveIcon from '@material-ui/icons/Save'; import MenuItem from '@material-ui/core/MenuItem'; import Grid from '@material-ui/core/Grid'; import { RestFormProps, FormActions, FormButton, BlockFormControlLabel } from '../components'; import { isIP, optional } from '../validators'; import { EMSESPSettings } from './EMSESPtypes'; type EMSESPSettingsFormProps = RestFormProps & WithWidthProps; class EMSESPSettingsForm extends React.Component { componentDidMount() { ValidatorForm.addValidationRule('isOptionalIP', optional(isIP)); } /* handleSliderChange = (name: keyof LedSettings) => (event: React.ChangeEvent<{}>, value: number | number[]) => { const { setData } = this.props; setData({ ...this.props.data!, [name]: value }); } */ render() { const { data, saveData, handleValueChange } = this.props; return ( Modify any EMS-ESP settings on this page. For help go to the {'wiki'}.

EMS Bus Off EMS EMS+ HT3 Hardware Service Key (0x0B) Modem (0x0D) Terminal (0x0A) Time Module (0x0F) Alarm Module (0x12)

Board Profile Choose from a pre-configured board layout to automatically set the GPIO pins Gateway S32 Gateway E32 (LAN8720) NodeMCU 32S Lolin D32 Olimex ESP32 Gateway (LAN8720) Ethernet (TLK110) Custom... { (data.board_profile === 0) && }

Options { data.dallas_gpio !== 0 && } label="Enable Dallas parasite mode" /> } { data.led_gpio !== 0 && } label="Invert LED" /> } } label="Shower Timer" /> {/* } label="Shower Alert" /> */} } label="Enable API write commands" /> } label="Enable ADC" />

Syslog } label="Enable Syslog" /> { data.syslog_enabled && OFF ERR NOTICE INFO DEBUG ALL } label="Output EMS telegrams in raw format" /> }

} variant="contained" color="primary" type="submit"> Save
); } } export default withWidth()(EMSESPSettingsForm);