Skip to content

Driver Maintenance — 0 scaffolded, 240 conflicts#512

Open
dlnraja wants to merge 1 commit into
masterfrom
auto/driver-maintenance
Open

Driver Maintenance — 0 scaffolded, 240 conflicts#512
dlnraja wants to merge 1 commit into
masterfrom
auto/driver-maintenance

Conversation

@dlnraja

@dlnraja dlnraja commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Automated Driver Maintenance

Auto-Scaffold Results

  • Scaffolded: 0 new drivers created from Johan SDK3
  • FPs added: 32 uncovered FPs added to existing drivers
  • Cross-class conflicts: 240

Conflict Audit

  • High severity PID conflicts: 240
  • MFR+PID duplicates (real risk): 10
  • Orphan drivers: 67
  • Split suggestions: 240

Reports

  • driver-scaffold-report.json — full scaffold details
  • driver-conflict-audit.json — full conflict analysis

Review checklist

  • Review scaffolded drivers — add DP mappings to device.js
  • Review high-severity conflicts — consider splitting drivers
  • 🤖 Dynamic Heuristic Check: Do not hardcode onoff.2 or standard alarm capabilities in app.json if UniversalVariantManager handles them dynamically.
  • Validate with npx homey app validate

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +10094 to +10095
const power = meta.state?.state === "ON" ? msg.data.acCurrentPowerValue / 1000 : 0;
return {power, ac_current_power_value: power};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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};

Comment on lines +10113 to +10114
const current = meta.state?.state === "ON" ? msg.data.acCurrentCurrentValue / 1000 : 0;
return {current, ac_current_current_value: current};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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};

Comment on lines +582 to 586
// Encode negative values as 2s complement
if (value < 0) {
value = 0x100000000 + value;
}
const hexValue = Number(value).toString(16).padStart(8, "0");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
// 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");

Comment on lines +3375 to +3378
if (parsedCapacityUnit === undefined) {
logger.error("manual_default_settings invalid irrigation_amount_unit, expected one of: us_gallon, liter.", NS);
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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; }

Comment on lines +4838 to +4841
if (irrigationAmountUnitCode === undefined) {
logger.error("irrigation_plan_settings invalid irrigation_amount_unit, expected one of: us_gallon, liter.", NS);
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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; }

dlnraja added a commit that referenced this pull request Jul 21, 2026
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)
dlnraja added a commit that referenced this pull request Jul 21, 2026
dlnraja added a commit that referenced this pull request Jul 22, 2026
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)
dlnraja added a commit that referenced this pull request Jul 23, 2026
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)
dlnraja added a commit that referenced this pull request Jul 23, 2026
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)
dlnraja added a commit that referenced this pull request Jul 23, 2026
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)
dlnraja added a commit that referenced this pull request Jul 23, 2026
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)
dlnraja added a commit that referenced this pull request Jul 23, 2026
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)
dlnraja added a commit that referenced this pull request Jul 23, 2026
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)
dlnraja added a commit that referenced this pull request Jul 23, 2026
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)
@dlnraja dlnraja changed the title Driver Maintenance — 0 scaffolded, 75 conflicts Driver Maintenance — 0 scaffolded, 240 conflicts Jul 24, 2026
@dlnraja
dlnraja force-pushed the auto/driver-maintenance branch from 2cb9842 to 4c374c7 Compare July 24, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant