Add support for DT4, DT5, and DT6 devices
- Updated CMakeLists.txt to include new source files for DT4, DT5, and DT6. - Modified dali.hpp to include headers for DT4, DT5, and DT6. - Added command definitions for DT4, DT5, and DT6 in dali_define.hpp. - Enhanced DaliDeviceCapabilities to support DT4, DT5, and DT6 detection. - Implemented DT4 and DT5 classes with methods for device control and status querying. - Created DT6 class with methods for device control and status querying. - Updated decode.cpp to include new device types in the deviceTypeName mapping. - Enhanced device.cpp to handle new device capabilities.
This commit is contained in:
@@ -49,6 +49,9 @@ DaliDeviceCapabilities DaliDeviceCapabilities::fromJson(const DaliValue::Object*
|
||||
DaliDeviceCapabilities c;
|
||||
if (!json) return c;
|
||||
c.supportsDt1 = getObjectBool(*json, "dt1");
|
||||
c.supportsDt4 = getObjectBool(*json, "dt4");
|
||||
c.supportsDt5 = getObjectBool(*json, "dt5");
|
||||
c.supportsDt6 = getObjectBool(*json, "dt6");
|
||||
c.supportsDt8 = getObjectBool(*json, "dt8");
|
||||
return c;
|
||||
}
|
||||
@@ -56,12 +59,18 @@ DaliDeviceCapabilities DaliDeviceCapabilities::fromJson(const DaliValue::Object*
|
||||
DaliValue::Object DaliDeviceCapabilities::toJson() const {
|
||||
DaliValue::Object out;
|
||||
if (supportsDt1.has_value()) out["dt1"] = supportsDt1.value();
|
||||
if (supportsDt4.has_value()) out["dt4"] = supportsDt4.value();
|
||||
if (supportsDt5.has_value()) out["dt5"] = supportsDt5.value();
|
||||
if (supportsDt6.has_value()) out["dt6"] = supportsDt6.value();
|
||||
if (supportsDt8.has_value()) out["dt8"] = supportsDt8.value();
|
||||
return out;
|
||||
}
|
||||
|
||||
void DaliDeviceCapabilities::merge(const DaliDeviceCapabilities& other) {
|
||||
if (!supportsDt1.has_value()) supportsDt1 = other.supportsDt1;
|
||||
if (!supportsDt4.has_value()) supportsDt4 = other.supportsDt4;
|
||||
if (!supportsDt5.has_value()) supportsDt5 = other.supportsDt5;
|
||||
if (!supportsDt6.has_value()) supportsDt6 = other.supportsDt6;
|
||||
if (!supportsDt8.has_value()) supportsDt8 = other.supportsDt8;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user