formatting

This commit is contained in:
Proddy
2022-04-18 11:05:38 +02:00
parent 101f94bea6
commit 9f6bbac8ce
10 changed files with 523 additions and 652 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -38,7 +38,7 @@ const ManageUsersForm: FC = () => {
BaseRow: ` BaseRow: `
font-size: 14px; font-size: 14px;
color: white; color: white;
`, `,
HeaderRow: ` HeaderRow: `
text-transform: uppercase; text-transform: uppercase;
background-color: black; background-color: black;
@@ -65,7 +65,7 @@ const ManageUsersForm: FC = () => {
&:hover { &:hover {
color: white; color: white;
} }
`, `,
BaseCell: ` BaseCell: `
border-top: 1px solid transparent; border-top: 1px solid transparent;
border-right: 1px solid transparent; border-right: 1px solid transparent;

View File

@@ -42,6 +42,7 @@ import EditOffOutlinedIcon from '@mui/icons-material/EditOffOutlined';
import CommentsDisabledOutlinedIcon from '@mui/icons-material/CommentsDisabledOutlined'; import CommentsDisabledOutlinedIcon from '@mui/icons-material/CommentsDisabledOutlined';
import KeyboardArrowUpOutlinedIcon from '@mui/icons-material/KeyboardArrowUpOutlined'; import KeyboardArrowUpOutlinedIcon from '@mui/icons-material/KeyboardArrowUpOutlined';
import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined'; import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';
import StarIcon from '@mui/icons-material/Star';
import DeviceIcon from './DeviceIcon'; import DeviceIcon from './DeviceIcon';
@@ -96,7 +97,7 @@ const DashboardData: FC = () => {
border-top: 1px solid #177ac9; border-top: 1px solid #177ac9;
border-bottom: 1px solid #177ac9; border-bottom: 1px solid #177ac9;
} }
`, `,
HeaderRow: ` HeaderRow: `
text-transform: uppercase; text-transform: uppercase;
background-color: black; background-color: black;
@@ -128,7 +129,7 @@ const DashboardData: FC = () => {
border-top: 1px solid #177ac9; border-top: 1px solid #177ac9;
border-bottom: 1px solid #177ac9; border-bottom: 1px solid #177ac9;
} }
`, `,
BaseCell: ` BaseCell: `
border-top: 1px solid transparent; border-top: 1px solid transparent;
border-right: 1px solid transparent; border-right: 1px solid transparent;
@@ -163,7 +164,7 @@ const DashboardData: FC = () => {
font-size: 14px; font-size: 14px;
color: white; color: white;
height: 32px; height: 32px;
`, `,
HeaderRow: ` HeaderRow: `
text-transform: uppercase; text-transform: uppercase;
background-color: black; background-color: black;
@@ -194,7 +195,7 @@ const DashboardData: FC = () => {
color: white; color: white;
cursor: 'pointer', cursor: 'pointer',
} }
`, `,
BaseCell: ` BaseCell: `
padding-left: 8px; padding-left: 8px;
border-top: 1px solid transparent; border-top: 1px solid transparent;
@@ -661,7 +662,7 @@ const DashboardData: FC = () => {
<HeaderCell resize>TYPE</HeaderCell> <HeaderCell resize>TYPE</HeaderCell>
<HeaderCell resize>DESCRIPTION</HeaderCell> <HeaderCell resize>DESCRIPTION</HeaderCell>
<HeaderCell>ENTITIES</HeaderCell> <HeaderCell>ENTITIES</HeaderCell>
<HeaderCell/> <HeaderCell />
</HeaderRow> </HeaderRow>
</Header> </Header>
<Body> <Body>
@@ -716,6 +717,7 @@ const DashboardData: FC = () => {
const renderNameCell = (dv: DeviceValue) => ( const renderNameCell = (dv: DeviceValue) => (
<> <>
{dv.id.slice(2)}&nbsp; {dv.id.slice(2)}&nbsp;
{hasMask(dv.id, DeviceEntityMask.DV_FAVORITE) && <StarIcon color="primary" sx={{ fontSize: 12 }} />}
{hasMask(dv.id, DeviceEntityMask.DV_READONLY) && <EditOffOutlinedIcon color="primary" sx={{ fontSize: 12 }} />} {hasMask(dv.id, DeviceEntityMask.DV_READONLY) && <EditOffOutlinedIcon color="primary" sx={{ fontSize: 12 }} />}
{hasMask(dv.id, DeviceEntityMask.DV_API_MQTT_EXCLUDE) && ( {hasMask(dv.id, DeviceEntityMask.DV_API_MQTT_EXCLUDE) && (
<CommentsDisabledOutlinedIcon color="primary" sx={{ fontSize: 12 }} /> <CommentsDisabledOutlinedIcon color="primary" sx={{ fontSize: 12 }} />
@@ -767,7 +769,7 @@ const DashboardData: FC = () => {
VALUE VALUE
</Button> </Button>
</HeaderCell> </HeaderCell>
<HeaderCell/> <HeaderCell />
</HeaderRow> </HeaderRow>
</Header> </Header>
<Body> <Body>

View File

@@ -91,7 +91,7 @@ const DashboardStatus: FC = () => {
BaseRow: ` BaseRow: `
font-size: 14px; font-size: 14px;
color: white; color: white;
`, `,
HeaderRow: ` HeaderRow: `
text-transform: uppercase; text-transform: uppercase;
background-color: black; background-color: black;
@@ -118,7 +118,7 @@ const DashboardStatus: FC = () => {
&:hover { &:hover {
color: white; color: white;
} }
`, `,
BaseCell: ` BaseCell: `
border-top: 1px solid transparent; border-top: 1px solid transparent;
border-right: 1px solid transparent; border-right: 1px solid transparent;

View File

@@ -54,9 +54,6 @@ const SettingsCustomization: FC = () => {
const [masks, setMasks] = useState(() => ['']); const [masks, setMasks] = useState(() => ['']);
const entities_theme = useTheme({ const entities_theme = useTheme({
Table: `
height: 100%;
`,
BaseRow: ` BaseRow: `
font-size: 14px; font-size: 14px;
color: white; color: white;
@@ -100,13 +97,13 @@ const SettingsCustomization: FC = () => {
border-right: 1px solid transparent; border-right: 1px solid transparent;
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
&:nth-of-type(1) { &:nth-of-type(1) {
width: 130px; left: 0px;
min-width: 124px;
width: 124px;
} }
&:nth-of-type(2) { &:nth-of-type(2) {
flex: 1; min-width: 70%;
} width: 70%;
&:last-of-type {
text-align: right;
} }
` `
}); });
@@ -302,10 +299,19 @@ const SettingsCustomization: FC = () => {
return ( return (
<> <>
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="center"> <Grid
container
ml={1}
mb={1}
mt={1}
spacing={1}
direction="row"
justifyContent="flex-start"
alignItems="center"
>
<Grid item> <Grid item>
<Typography sx={{ pt: 1, pb: 1 }} variant="subtitle2" color="primary"> <Typography align="right" variant="subtitle2" color="primary">
Apply filter:&nbsp; Set filter:&nbsp;
</Typography> </Typography>
</Grid> </Grid>
<Grid item> <Grid item>
@@ -354,13 +360,13 @@ const SettingsCustomization: FC = () => {
data={{ nodes: deviceEntities.filter((de) => de.m & selectedFilters || !selectedFilters) }} data={{ nodes: deviceEntities.filter((de) => de.m & selectedFilters || !selectedFilters) }}
theme={entities_theme} theme={entities_theme}
sort={entity_sort} sort={entity_sort}
layout={{ custom: true }} layout={{ custom: true, horizontalScroll: true }}
> >
{(tableList: any) => ( {(tableList: any) => (
<> <>
<Header> <Header>
<HeaderRow> <HeaderRow>
<HeaderCell>OPTIONS</HeaderCell> <HeaderCell pinLeft>OPTIONS</HeaderCell>
<HeaderCell resize> <HeaderCell resize>
<Button <Button
fullWidth fullWidth
@@ -371,7 +377,7 @@ const SettingsCustomization: FC = () => {
NAME NAME
</Button> </Button>
</HeaderCell> </HeaderCell>
<HeaderCell pinRight={true}>VALUE</HeaderCell> <HeaderCell>VALUE</HeaderCell>
<HeaderCell /> <HeaderCell />
</HeaderRow> </HeaderRow>
</Header> </Header>

View File

@@ -555,19 +555,19 @@ const emsesp_devicedata_4 = {
{ {
v: 16, v: 16,
u: 1, u: 1,
id: '00hc2 selected room temperature', id: '08hc2 selected room temperature',
c: 'hc2/seltemp', c: 'hc2/seltemp',
}, },
{ {
v: 18.6, v: 18.6,
u: 1, u: 1,
id: '00hc2 current room temperature', id: '02hc2 current room temperature',
c: '', c: '',
}, },
{ {
v: 'off', v: 'off',
u: 0, u: 0,
id: '00hc2 mode', id: '02hc2 mode',
c: 'hc2/mode', c: 'hc2/mode',
}, },
], ],
@@ -705,14 +705,14 @@ const emsesp_deviceentities_4 = [
v: 18.5, v: 18.5,
id: 'hc2 current room temperature', id: 'hc2 current room temperature',
s: 'hc2/curtemp', s: 'hc2/curtemp',
m: 3, m: 2,
w: false, w: false,
}, },
{ {
v: 'off', v: 'off',
id: 'hc2 mode', id: 'hc2 mode',
s: 'hc2/mode', s: 'hc2/mode',
m: 3, m: 2,
w: true, w: true,
}, },
] ]

View File

@@ -460,7 +460,7 @@ bool AnalogSensor::command_info(const char * value, const int8_t id, JsonObject
for (const auto & sensor : sensors_) { for (const auto & sensor : sensors_) {
if (id == -1) { // show number and id if (id == -1) { // show number and id
JsonObject dataSensor = output.createNestedObject(sensor.name()); JsonObject dataSensor = output.createNestedObject(sensor.name());
dataSensor["gpio"] = sensor.gpio(); dataSensor["gpio"] = sensor.gpio();
dataSensor["type"] = FL_(enum_sensortype)[sensor.type()]; dataSensor["type"] = FL_(enum_sensortype)[sensor.type()];
if (sensor.type() == AnalogType::ADC) { if (sensor.type() == AnalogType::ADC) {
dataSensor["uom"] = EMSdevice::uom_to_string(sensor.uom()); dataSensor["uom"] = EMSdevice::uom_to_string(sensor.uom());

View File

@@ -193,7 +193,7 @@ class Boiler : public EMSdevice {
// Pool unit // Pool unit
int8_t poolSetTemp_; int8_t poolSetTemp_;
/* /*
* Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat * Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat
* thermostat always overwrites settings in boiler * thermostat always overwrites settings in boiler
* enable settings here if no thermostat is used in system * enable settings here if no thermostat is used in system

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.4.0b12" #define EMSESP_APP_VERSION "3.4.0b12t"

View File

@@ -61,7 +61,7 @@ void WebCustomization::read(WebCustomization & settings, JsonObject & root) {
JsonArray sensorsJson = root.createNestedArray("sensors"); JsonArray sensorsJson = root.createNestedArray("sensors");
for (const SensorCustomization & sensor : settings.sensorCustomizations) { for (const SensorCustomization & sensor : settings.sensorCustomizations) {
JsonObject sensorJson = sensorsJson.createNestedObject(); JsonObject sensorJson = sensorsJson.createNestedObject();
sensorJson["id"] = sensor.id; // is sensorJson["id"] = sensor.id; // is
sensorJson["name"] = sensor.name; // n sensorJson["name"] = sensor.name; // n
sensorJson["offset"] = sensor.offset; // o sensorJson["offset"] = sensor.offset; // o
} }
@@ -101,7 +101,7 @@ StateUpdateResult WebCustomization::update(JsonObject & root, WebCustomization &
for (const JsonObject sensorJson : root["sensors"].as<JsonArray>()) { for (const JsonObject sensorJson : root["sensors"].as<JsonArray>()) {
// create each of the sensor, overwritting any previous settings // create each of the sensor, overwritting any previous settings
auto sensor = SensorCustomization(); auto sensor = SensorCustomization();
sensor.id = sensorJson["id"].as<std::string>(); sensor.id = sensorJson["id"].as<std::string>();
sensor.name = sensorJson["name"].as<std::string>(); sensor.name = sensorJson["name"].as<std::string>();
sensor.offset = sensorJson["offset"]; sensor.offset = sensorJson["offset"];
settings.sensorCustomizations.push_back(sensor); // add to list settings.sensorCustomizations.push_back(sensor); // add to list