Refactor MQTT subscriptions #173

This commit is contained in:
proddy
2021-11-01 23:31:30 +01:00
parent 40a7026d4c
commit 01bace4048
38 changed files with 873 additions and 942 deletions

View File

@@ -187,23 +187,16 @@ class MqttSettingsForm extends React.Component<MqttSettingsFormProps> {
<MenuItem value={1}>Nested on a single topic</MenuItem>
<MenuItem value={2}>As individual topics</MenuItem>
</SelectValidator>
<SelectValidator
name="subscribe_format"
label="Subscribe Topics"
value={data.subscribe_format}
fullWidth
variant="outlined"
onChange={handleValueChange('subscribe_format')}
margin="normal"
>
<MenuItem value={0}>one topic per device</MenuItem>
<MenuItem value={1}>
topics for each device and it's values (main heating circuit only)
</MenuItem>
<MenuItem value={2}>
topic for each device and it's values (all heating circuits)
</MenuItem>
</SelectValidator>
<BlockFormControlLabel
control={
<Checkbox
checked={data.send_response}
onChange={handleValueChange('send_response')}
value="send_response"
/>
}
label="Publish command output to a 'response' topic"
/>
<BlockFormControlLabel
control={
<Checkbox

View File

@@ -39,5 +39,5 @@ export interface MqttSettings {
ha_enabled: boolean;
ha_climate_format: number;
nested_format: number;
subscribe_format: number;
send_response: boolean;
}

View File

@@ -64,11 +64,11 @@ export interface EMSESPData {
}
export interface DeviceValue {
v: any;
u: number;
n: string;
c: string;
l: string[];
v: any; // value, in any format
u: number; // uom
n: string; // name
c: string; // command
l: string[]; // list
}
export interface EMSESPDeviceData {