Skip to content

Commit

Permalink
chore: Misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Jun 8, 2024
1 parent 6ca4eb9 commit 0a036ef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const capabilities = require("../../core/capabilities");
const ComponentType = require("../homeassistant/ComponentType");
const DataType = require("../homie/DataType");
const EntityCategory = require("../homeassistant/EntityCategory");
const HassAnchor = require("../homeassistant/HassAnchor");
const InLineHassComponent = require("../homeassistant/components/InLineHassComponent");
const PropertyMqttHandle = require("../handles/PropertyMqttHandle");

Expand Down Expand Up @@ -38,9 +37,7 @@ class SpeakerVolumeControlCapabilityMqttHandle extends CapabilityMqttHandle {
}
},
getter: async () => {
return this.controller.hassAnchorProvider.getAnchor(
HassAnchor.ANCHOR.SPEAKER_VOLUME
).getValue();
return this.capability.getVolume();
},
helpText: "This handle returns the current speaker volume"
}).also((prop) => {
Expand All @@ -64,15 +61,6 @@ class SpeakerVolumeControlCapabilityMqttHandle extends CapabilityMqttHandle {
})
);
}

async refresh() {
const currentVolume = await this.capability.getVolume();
await this.controller.hassAnchorProvider.getAnchor(
HassAnchor.ANCHOR.SPEAKER_VOLUME
).post(currentVolume);

await super.refresh();
}
}

SpeakerVolumeControlCapabilityMqttHandle.OPTIONAL = true;
Expand Down
3 changes: 1 addition & 2 deletions backend/lib/mqtt/homeassistant/HassAnchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ HassAnchor.ANCHOR = Object.freeze({
WIFI_IPS: "wifi_ips",
WIFI_FREQUENCY: "wifi_freq",
WIFI_SIGNAL: "wifi_signal",
WIFI_SSID: "wifi_ssid",
SPEAKER_VOLUME: "speaker_volume",
WIFI_SSID: "wifi_ssid"
});

HassAnchor.REFERENCE = Object.freeze({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DreameCarpetSensorModeControlCapability extends CarpetSensorModeControlCap
this.siid = DreameMiotServices["GEN2"].VACUUM_2.SIID;
this.sensor_piid = DreameMiotServices["GEN2"].VACUUM_2.PROPERTIES.CARPET_DETECTION_SENSOR.PIID;
this.mode_piid = DreameMiotServices["GEN2"].VACUUM_2.PROPERTIES.CARPET_DETECTION_SENSOR_MODE.PIID;
this.mop_detach_piid =DreameMiotServices["GEN2"].VACUUM_2.PROPERTIES.MOP_DETACH.PIID;
this.mop_detach_piid = DreameMiotServices["GEN2"].VACUUM_2.PROPERTIES.MOP_DETACH.PIID;

this.helper = new DreameMiotHelper({robot: this.robot});
}
Expand Down
1 change: 1 addition & 0 deletions util/generate_mqtt_docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ order: 20
To make your robot talk to your MQTT broker and integrate with home automation software, such as but not limited to
Home Assistant, openHAB and Node-RED, configure MQTT via Valetudo's web interface (Connectivity → MQTT connectivity).
On this page you can also find the exact topic to which to send commands to or from.
## Autodiscovery
Expand Down

0 comments on commit 0a036ef

Please sign in to comment.