Enable setting position from MQTT
This commit is contained in:
@@ -20,7 +20,8 @@ RF24 radio(RF_CE_PIN, RF_CS_PIN);
|
||||
static const uint8_t rfID[2] = { 0xC8, 0x2E }; // 0x2EC8
|
||||
|
||||
PacketReceiver packetReceiver(&radio);
|
||||
PacketBuilder remotePacketBuilder(0x369E, 0xAC, 0x82);
|
||||
PacketBuilder remotePacketBuilder(0x369E, 0xAC, 0x82, 0x06);
|
||||
PacketBuilder hubPacketBuilder(0x0000, 0x3D, 0x96, 0x05);
|
||||
|
||||
EspMQTTClient client(
|
||||
SECRET_WIFI_SSID, // Wifi SSID
|
||||
@@ -151,7 +152,10 @@ void onConnectionEstablished() {
|
||||
});
|
||||
|
||||
client.subscribe("hotdog/test_mqtt_blind/set_position", [] (const String &payload) {
|
||||
|
||||
uint16_t shadeID = 0x4EF1;
|
||||
float percentage = payload.toInt() / 100.0f;
|
||||
hubPacketBuilder.buildPositionPacket(buffer, shadeID, percentage);
|
||||
sendCommand(buffer);
|
||||
});
|
||||
|
||||
client.publish("hotdog/availability", "online", true);
|
||||
|
||||
Reference in New Issue
Block a user