Add NoWarnings BatteryType
This commit is contained in:
Submodule lib/nuki_ble updated: b70c93e120...7aa266dfc5
@@ -1568,6 +1568,7 @@ void HomeAssistantDiscovery::publishHASSConfigAdditionalLockEntities(char *devic
|
|||||||
json["options"][0] = "Alkali";
|
json["options"][0] = "Alkali";
|
||||||
json["options"][1] = "Accumulators";
|
json["options"][1] = "Accumulators";
|
||||||
json["options"][2] = "Lithium";
|
json["options"][2] = "Lithium";
|
||||||
|
json["options"][3] = "No Warnings";
|
||||||
serializeJson(json, _buffer, _bufferSize);
|
serializeJson(json, _buffer, _bufferSize);
|
||||||
String path = createHassTopicPath("select", "battery_type", uidString);
|
String path = createHassTopicPath("select", "battery_type", uidString);
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, _buffer);
|
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, _buffer);
|
||||||
@@ -2859,6 +2860,7 @@ void HomeAssistantDiscovery::publishHASSConfigAdditionalOpenerEntities(char *dev
|
|||||||
json["options"][0] = "Alkali";
|
json["options"][0] = "Alkali";
|
||||||
json["options"][1] = "Accumulators";
|
json["options"][1] = "Accumulators";
|
||||||
json["options"][2] = "Lithium";
|
json["options"][2] = "Lithium";
|
||||||
|
json["options"][3] = "No Warnings";
|
||||||
serializeJson(json, _buffer, _bufferSize);
|
serializeJson(json, _buffer, _bufferSize);
|
||||||
String path = createHassTopicPath("select", "battery_type", uidString);
|
String path = createHassTopicPath("select", "battery_type", uidString);
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, _buffer);
|
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, _buffer);
|
||||||
|
|||||||
@@ -1583,6 +1583,9 @@ void NukiNetwork::batteryTypeToString(const Nuki::BatteryType battype, char* str
|
|||||||
case Nuki::BatteryType::Lithium:
|
case Nuki::BatteryType::Lithium:
|
||||||
strcpy(str, "Lithium");
|
strcpy(str, "Lithium");
|
||||||
break;
|
break;
|
||||||
|
case Nuki::BatteryType::NoWarnings:
|
||||||
|
strcpy(str, "No Warnings");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
strcpy(str, "undefined");
|
strcpy(str, "undefined");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -329,6 +329,10 @@ const Nuki::BatteryType NukiHelper::batteryTypeToEnum(const char* str)
|
|||||||
{
|
{
|
||||||
return Nuki::BatteryType::Lithium;
|
return Nuki::BatteryType::Lithium;
|
||||||
}
|
}
|
||||||
|
else if(strcmp(str, "No Warnings") == 0)
|
||||||
|
{
|
||||||
|
return Nuki::BatteryType::NoWarnings;
|
||||||
|
}
|
||||||
return (Nuki::BatteryType)0xff;
|
return (Nuki::BatteryType)0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -268,6 +268,10 @@ const Nuki::BatteryType NukiOpenerHelper::batteryTypeToEnum(const char* str)
|
|||||||
{
|
{
|
||||||
return Nuki::BatteryType::Lithium;
|
return Nuki::BatteryType::Lithium;
|
||||||
}
|
}
|
||||||
|
else if(strcmp(str, "No Warnings") == 0)
|
||||||
|
{
|
||||||
|
return Nuki::BatteryType::NoWarnings;
|
||||||
|
}
|
||||||
return (Nuki::BatteryType)0xff;
|
return (Nuki::BatteryType)0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user