grzegorz914/homebridge-tasmota-control

bug: incompatibility of firmware smaller than 12.1.1

Closed this issue · 1 comments

Solution to support tasmota devices with firmware older than 12.1.1
See comment in source code.

const API_COMMANDS = {
  // To support devices with firmware v12.1.1 or older, a Status 0 must be entered here instead of Status0.
  Status: "Status0",
  //
  PowerStatus: "Power0", //0,1,2 - Power all
  Power: "Power",
  Off: "%20off", //0
  On: "%20on", //1
  Toggle: "%20toggle", //2
  Blink: "%20blink", //3
  BlinkOff: "%20blinkoff", //4
};
const deviceName = deviceInfo.data.Status.DeviceName;
      const friendlyName = Array.isArray(deviceInfo.data.Status.FriendlyName) ? deviceInfo.data.Status.FriendlyName : [];
      const friendlyNameCount = friendlyName.length;
      //Here a query should check if deviceInfo.data.StatusFWR.Hardware is undefned.
      //Because in a firmware older than v12.1.1 there is no flag Hardware.
      //If it is undefined just set an empty string.
      //Tested with Homebridge v.4.50.1 and Tasmota firmware 12.1.1 and 6.3.0 works without problems.
      const modelName = deviceInfo.data.StatusFWR.Hardware;
      //////
      const addressMac = deviceInfo.data.StatusNET.Mac;
      const firmwareRevision = deviceInfo.data.StatusFWR.Version;

Added in 0.5.0