Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions NeewerLite/NeewerLite/Model/NeewerLightConstant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class NeewerLightConstant {
return "MS150"
case 82:
return "CB300C"
case 84:
case 70:
return "CB120B"
case 83:
return "AP150C-2"
Expand Down Expand Up @@ -232,6 +232,8 @@ class NeewerLightConstant {
return "FS150 5600K"
case "20230064":
return "TL60 RGB"
case "20230112":
return "CB120B"
case "20240063":
return "BH20C"
default:
Expand Down Expand Up @@ -597,7 +599,8 @@ class NeewerLightConstant {
return lightType
}
if nickName.contains("CB120B") {
lightType = 84
// Database profile is type 70 (Database/lights.json); 84 has no profile.
lightType = 70
return lightType
}
if nickName.contains("AP150C-2") {
Expand Down
6 changes: 6 additions & 0 deletions NeewerLite/NeewerLiteTests/NeewerLiteTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class NeewerLiteTests: XCTestCase {
XCTAssertEqual(name.projectName, "RGB660 PRO")
XCTAssertEqual(NeewerLightConstant.getLightType(nickName: name.nickName, rawname: "", projectName: name.projectName), 3, "")

// CB120B advertises as NW-20230112&<serial>; must resolve to database profile type 70.
name = NeewerLightConstant.getLightNames(rawName: "NW-20230112&03440600", identifier: "09418809-75CF-237B-661C-622A217457D1")
XCTAssertEqual(name.nickName, "CB120B-7457D1")
XCTAssertEqual(name.projectName, "CB120B")
XCTAssertEqual(NeewerLightConstant.getLightType(nickName: name.nickName, rawname: "NW-20230112&03440600", projectName: name.projectName), 70, "")

name = NeewerLightConstant.getLightNames(rawName: "GR18C-953999", identifier: "DEE0BA8C-D9B4-B7DB-0FD2-2531C7E4B053")
XCTAssertEqual(name.nickName, "GR18C-953999-E4B053")
XCTAssertEqual(name.projectName, "GR18C-953999")
Expand Down