Driver Maintenance — 0 scaffolded, 240 conflicts#512
Conversation
fe88688 to
2cb9842
Compare
There was a problem hiding this comment.
Code Review
This pull request adds support for the SONOFF S61SZBTPB smart plug and Dongle-PP10 router, enhances Sonoff SWV valves with unified water flow units, refactors Tuya buffer/decimal converters, and updates various device fingerprints. The review feedback recommends checking for an explicit 'OFF' state instead of 'ON' to prevent incorrect power/current reporting on startup for the new smart plug. It also suggests using the unsigned right shift operator (>>> 0) for robust 32-bit integer conversion in Tuya utilities, and making irrigation unit error messages dynamic based on firmware capabilities.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const power = meta.state?.state === "ON" ? msg.data.acCurrentPowerValue / 1000 : 0; | ||
| return {power, ac_current_power_value: power}; |
There was a problem hiding this comment.
Checking if meta.state?.state === "ON" to report power will incorrectly report 0 power on startup or re-pairing when the state is not yet cached/known. It is safer to check if the state is explicitly "OFF" to force 0, and otherwise report the actual reading.
| const power = meta.state?.state === "ON" ? msg.data.acCurrentPowerValue / 1000 : 0; | |
| return {power, ac_current_power_value: power}; | |
| const power = meta.state?.state === "OFF" ? 0 : msg.data.acCurrentPowerValue / 1000; return {power, ac_current_power_value: power}; |
| const current = meta.state?.state === "ON" ? msg.data.acCurrentCurrentValue / 1000 : 0; | ||
| return {current, ac_current_current_value: current}; |
There was a problem hiding this comment.
Checking if meta.state?.state === "ON" to report current will incorrectly report 0 current on startup or re-pairing when the state is not yet cached/known. It is safer to check if the state is explicitly "OFF" to force 0, and otherwise report the actual reading.
| const current = meta.state?.state === "ON" ? msg.data.acCurrentCurrentValue / 1000 : 0; | |
| return {current, ac_current_current_value: current}; | |
| const current = meta.state?.state === "OFF" ? 0 : msg.data.acCurrentCurrentValue / 1000; return {current, ac_current_current_value: current}; |
| // Encode negative values as 2s complement | ||
| if (value < 0) { | ||
| value = 0x100000000 + value; | ||
| } | ||
| const hexValue = Number(value).toString(16).padStart(8, "0"); |
There was a problem hiding this comment.
Using value >>> 0 is a more robust and standard way to convert a number to an unsigned 32-bit integer in JavaScript/TypeScript. It automatically handles negative numbers (2's complement) and constrains the value to 32 bits, avoiding potential issues with non-integers or extremely large numbers.
| // Encode negative values as 2s complement | |
| if (value < 0) { | |
| value = 0x100000000 + value; | |
| } | |
| const hexValue = Number(value).toString(16).padStart(8, "0"); | |
| const hexValue = (value >>> 0).toString(16).padStart(8, "0"); |
| if (parsedCapacityUnit === undefined) { | ||
| logger.error("manual_default_settings invalid irrigation_amount_unit, expected one of: us_gallon, liter.", NS); | ||
| return; | ||
| } |
There was a problem hiding this comment.
If the device firmware supports unified imperial gallons, imperial_gallon is also a valid unit. The error message should dynamically reflect the allowed units based on firmware support to avoid misleading logs.
if (parsedCapacityUnit === undefined) { logger.error("manual_default_settings invalid irrigation_amount_unit, expected one of: ${SWVZNEFirmwareSupportsUnifiedImperialGallon(meta.device) ? "us_gallon, liter, imperial_gallon" : "us_gallon, liter"}.", NS); return; }| if (irrigationAmountUnitCode === undefined) { | ||
| logger.error("irrigation_plan_settings invalid irrigation_amount_unit, expected one of: us_gallon, liter.", NS); | ||
| return; | ||
| } |
There was a problem hiding this comment.
If the device firmware supports unified imperial gallons, imperial_gallon is also a valid unit. The error message should dynamically reflect the allowed units based on firmware support to avoid misleading logs.
if (irrigationAmountUnitCode === undefined) { logger.error("irrigation_plan_settings invalid irrigation_amount_unit, expected one of: ${SWVZNEFirmwareSupportsUnifiedImperialGallon(meta.device) ? "us_gallon, liter, imperial_gallon" : "us_gallon, liter"}.", NS); return; }Issue #439 (open auto-scan): - Apply 685 missing mfrs to generic_tuya/driver.compose.json - 955 total FPs found in issue body, 685 unique not yet in any driver PR #512 (open driver maintenance 75 conflicts): - Audit 431 drivers: 75 high-severity PID conflicts, 9 Sacred Couple mfr+pid duplicates (already baselined in P76.1), 63 orphan drivers - Build enrich-orphan-drivers.js (v4 cross-orphan safe) - Apply 135 unique mfrs to 7 zigbee orphan drivers without creating new Sacred Couple collisions: - device_radiator_valve_smart: +31 mfrs (thermostat) - switch_2_gang: +11 mfrs (socket) - switch_wireless: +45 mfrs (sensor) - temphumidsensor5: +2 mfrs (sensor) - valvecontroller: +6 mfrs (other) - wall_switch_5_gang_tuya: +39 mfrs (socket) - flood_sensor: +1 mfrs (sensor) Forum: poll returned 0 new posts, no new FPs to apply (last seen 2025-07-26). Tests: 28/28 architectural tests PASS, 0 new FP collisions. generic_tuya: 444 -> 1129 FPs (+685) Total mfrs: 5712 -> 5909 (+197 net, 685+135=820 added, 623 dups from issue #439)
Issue #439 (open auto-scan): - Apply 685 missing mfrs to generic_tuya/driver.compose.json - 955 total FPs found in issue body, 685 unique not yet in any driver PR #512 (open driver maintenance 75 conflicts): - Audit 431 drivers: 75 high-severity PID conflicts, 9 Sacred Couple mfr+pid duplicates (already baselined in P76.1), 63 orphan drivers - Build enrich-orphan-drivers.js (v4 cross-orphan safe) - Apply 135 unique mfrs to 7 zigbee orphan drivers without creating new Sacred Couple collisions: - device_radiator_valve_smart: +31 mfrs (thermostat) - switch_2_gang: +11 mfrs (socket) - switch_wireless: +45 mfrs (sensor) - temphumidsensor5: +2 mfrs (sensor) - valvecontroller: +6 mfrs (other) - wall_switch_5_gang_tuya: +39 mfrs (socket) - flood_sensor: +1 mfrs (sensor) Forum: poll returned 0 new posts, no new FPs to apply (last seen 2025-07-26). Tests: 28/28 architectural tests PASS, 0 new FP collisions. generic_tuya: 444 -> 1129 FPs (+685) Total mfrs: 5712 -> 5909 (+197 net, 685+135=820 added, 623 dups from issue #439)
Issue #439 (open auto-scan): - Apply 685 missing mfrs to generic_tuya/driver.compose.json - 955 total FPs found in issue body, 685 unique not yet in any driver PR #512 (open driver maintenance 75 conflicts): - Audit 431 drivers: 75 high-severity PID conflicts, 9 Sacred Couple mfr+pid duplicates (already baselined in P76.1), 63 orphan drivers - Build enrich-orphan-drivers.js (v4 cross-orphan safe) - Apply 135 unique mfrs to 7 zigbee orphan drivers without creating new Sacred Couple collisions: - device_radiator_valve_smart: +31 mfrs (thermostat) - switch_2_gang: +11 mfrs (socket) - switch_wireless: +45 mfrs (sensor) - temphumidsensor5: +2 mfrs (sensor) - valvecontroller: +6 mfrs (other) - wall_switch_5_gang_tuya: +39 mfrs (socket) - flood_sensor: +1 mfrs (sensor) Forum: poll returned 0 new posts, no new FPs to apply (last seen 2025-07-26). Tests: 28/28 architectural tests PASS, 0 new FP collisions. generic_tuya: 444 -> 1129 FPs (+685) Total mfrs: 5712 -> 5909 (+197 net, 685+135=820 added, 623 dups from issue #439)
Issue #439 (open auto-scan): - Apply 685 missing mfrs to generic_tuya/driver.compose.json - 955 total FPs found in issue body, 685 unique not yet in any driver PR #512 (open driver maintenance 75 conflicts): - Audit 431 drivers: 75 high-severity PID conflicts, 9 Sacred Couple mfr+pid duplicates (already baselined in P76.1), 63 orphan drivers - Build enrich-orphan-drivers.js (v4 cross-orphan safe) - Apply 135 unique mfrs to 7 zigbee orphan drivers without creating new Sacred Couple collisions: - device_radiator_valve_smart: +31 mfrs (thermostat) - switch_2_gang: +11 mfrs (socket) - switch_wireless: +45 mfrs (sensor) - temphumidsensor5: +2 mfrs (sensor) - valvecontroller: +6 mfrs (other) - wall_switch_5_gang_tuya: +39 mfrs (socket) - flood_sensor: +1 mfrs (sensor) Forum: poll returned 0 new posts, no new FPs to apply (last seen 2025-07-26). Tests: 28/28 architectural tests PASS, 0 new FP collisions. generic_tuya: 444 -> 1129 FPs (+685) Total mfrs: 5712 -> 5909 (+197 net, 685+135=820 added, 623 dups from issue #439)
Issue #439 (open auto-scan): - Apply 685 missing mfrs to generic_tuya/driver.compose.json - 955 total FPs found in issue body, 685 unique not yet in any driver PR #512 (open driver maintenance 75 conflicts): - Audit 431 drivers: 75 high-severity PID conflicts, 9 Sacred Couple mfr+pid duplicates (already baselined in P76.1), 63 orphan drivers - Build enrich-orphan-drivers.js (v4 cross-orphan safe) - Apply 135 unique mfrs to 7 zigbee orphan drivers without creating new Sacred Couple collisions: - device_radiator_valve_smart: +31 mfrs (thermostat) - switch_2_gang: +11 mfrs (socket) - switch_wireless: +45 mfrs (sensor) - temphumidsensor5: +2 mfrs (sensor) - valvecontroller: +6 mfrs (other) - wall_switch_5_gang_tuya: +39 mfrs (socket) - flood_sensor: +1 mfrs (sensor) Forum: poll returned 0 new posts, no new FPs to apply (last seen 2025-07-26). Tests: 28/28 architectural tests PASS, 0 new FP collisions. generic_tuya: 444 -> 1129 FPs (+685) Total mfrs: 5712 -> 5909 (+197 net, 685+135=820 added, 623 dups from issue #439)
Issue #439 (open auto-scan): - Apply 685 missing mfrs to generic_tuya/driver.compose.json - 955 total FPs found in issue body, 685 unique not yet in any driver PR #512 (open driver maintenance 75 conflicts): - Audit 431 drivers: 75 high-severity PID conflicts, 9 Sacred Couple mfr+pid duplicates (already baselined in P76.1), 63 orphan drivers - Build enrich-orphan-drivers.js (v4 cross-orphan safe) - Apply 135 unique mfrs to 7 zigbee orphan drivers without creating new Sacred Couple collisions: - device_radiator_valve_smart: +31 mfrs (thermostat) - switch_2_gang: +11 mfrs (socket) - switch_wireless: +45 mfrs (sensor) - temphumidsensor5: +2 mfrs (sensor) - valvecontroller: +6 mfrs (other) - wall_switch_5_gang_tuya: +39 mfrs (socket) - flood_sensor: +1 mfrs (sensor) Forum: poll returned 0 new posts, no new FPs to apply (last seen 2025-07-26). Tests: 28/28 architectural tests PASS, 0 new FP collisions. generic_tuya: 444 -> 1129 FPs (+685) Total mfrs: 5712 -> 5909 (+197 net, 685+135=820 added, 623 dups from issue #439)
Issue #439 (open auto-scan): - Apply 685 missing mfrs to generic_tuya/driver.compose.json - 955 total FPs found in issue body, 685 unique not yet in any driver PR #512 (open driver maintenance 75 conflicts): - Audit 431 drivers: 75 high-severity PID conflicts, 9 Sacred Couple mfr+pid duplicates (already baselined in P76.1), 63 orphan drivers - Build enrich-orphan-drivers.js (v4 cross-orphan safe) - Apply 135 unique mfrs to 7 zigbee orphan drivers without creating new Sacred Couple collisions: - device_radiator_valve_smart: +31 mfrs (thermostat) - switch_2_gang: +11 mfrs (socket) - switch_wireless: +45 mfrs (sensor) - temphumidsensor5: +2 mfrs (sensor) - valvecontroller: +6 mfrs (other) - wall_switch_5_gang_tuya: +39 mfrs (socket) - flood_sensor: +1 mfrs (sensor) Forum: poll returned 0 new posts, no new FPs to apply (last seen 2025-07-26). Tests: 28/28 architectural tests PASS, 0 new FP collisions. generic_tuya: 444 -> 1129 FPs (+685) Total mfrs: 5712 -> 5909 (+197 net, 685+135=820 added, 623 dups from issue #439)
Issue #439 (open auto-scan): - Apply 685 missing mfrs to generic_tuya/driver.compose.json - 955 total FPs found in issue body, 685 unique not yet in any driver PR #512 (open driver maintenance 75 conflicts): - Audit 431 drivers: 75 high-severity PID conflicts, 9 Sacred Couple mfr+pid duplicates (already baselined in P76.1), 63 orphan drivers - Build enrich-orphan-drivers.js (v4 cross-orphan safe) - Apply 135 unique mfrs to 7 zigbee orphan drivers without creating new Sacred Couple collisions: - device_radiator_valve_smart: +31 mfrs (thermostat) - switch_2_gang: +11 mfrs (socket) - switch_wireless: +45 mfrs (sensor) - temphumidsensor5: +2 mfrs (sensor) - valvecontroller: +6 mfrs (other) - wall_switch_5_gang_tuya: +39 mfrs (socket) - flood_sensor: +1 mfrs (sensor) Forum: poll returned 0 new posts, no new FPs to apply (last seen 2025-07-26). Tests: 28/28 architectural tests PASS, 0 new FP collisions. generic_tuya: 444 -> 1129 FPs (+685) Total mfrs: 5712 -> 5909 (+197 net, 685+135=820 added, 623 dups from issue #439)
Issue #439 (open auto-scan): - Apply 685 missing mfrs to generic_tuya/driver.compose.json - 955 total FPs found in issue body, 685 unique not yet in any driver PR #512 (open driver maintenance 75 conflicts): - Audit 431 drivers: 75 high-severity PID conflicts, 9 Sacred Couple mfr+pid duplicates (already baselined in P76.1), 63 orphan drivers - Build enrich-orphan-drivers.js (v4 cross-orphan safe) - Apply 135 unique mfrs to 7 zigbee orphan drivers without creating new Sacred Couple collisions: - device_radiator_valve_smart: +31 mfrs (thermostat) - switch_2_gang: +11 mfrs (socket) - switch_wireless: +45 mfrs (sensor) - temphumidsensor5: +2 mfrs (sensor) - valvecontroller: +6 mfrs (other) - wall_switch_5_gang_tuya: +39 mfrs (socket) - flood_sensor: +1 mfrs (sensor) Forum: poll returned 0 new posts, no new FPs to apply (last seen 2025-07-26). Tests: 28/28 architectural tests PASS, 0 new FP collisions. generic_tuya: 444 -> 1129 FPs (+685) Total mfrs: 5712 -> 5909 (+197 net, 685+135=820 added, 623 dups from issue #439)
2cb9842 to
4c374c7
Compare
Automated Driver Maintenance
Auto-Scaffold Results
Conflict Audit
Reports
driver-scaffold-report.json— full scaffold detailsdriver-conflict-audit.json— full conflict analysisReview checklist
onoff.2or standard alarm capabilities inapp.jsonifUniversalVariantManagerhandles them dynamically.npx homey app validate