mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
Refactor MQTT subscriptions #173
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -39,5 +39,5 @@ export interface MqttSettings {
|
||||
ha_enabled: boolean;
|
||||
ha_climate_format: number;
|
||||
nested_format: number;
|
||||
subscribe_format: number;
|
||||
send_response: boolean;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user