Skip to content

Merge pull request #41 from FuzzysTodd/SA#42

Merged
FuzzysTodd merged 1 commit into
SAfrom
sa/dependabot-compat-fixes
Nov 16, 2025
Merged

Merge pull request #41 from FuzzysTodd/SA#42
FuzzysTodd merged 1 commit into
SAfrom
sa/dependabot-compat-fixes

Conversation

@FuzzysTodd

Copy link
Copy Markdown
Owner

self

Copilot AI review requested due to automatic review settings November 16, 2025 03:06

Copilot AI 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.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@FuzzysTodd FuzzysTodd merged commit adf42d5 into SA Nov 16, 2025
0 of 2 checks passed
@FuzzysTodd FuzzysTodd linked an issue Nov 21, 2025 that may be closed by this pull request

@FuzzysTodd FuzzysTodd left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@FuzzysTodd make this bot for scripting scripts/issueBot.mjs scripts/issueBot.mjs import {execSync} from "node:child_process";Add a comment on lines R1 to R13Add diff commentMarkdown input: edit mode selected.WritePreviewHeadingBoldItalicQuoteCodeLinkUnordered listNumbered listTask listMentionReferenceSaved repliesAdd FilesPaste, drop, or click to add filesCancelCommentexport async function newDeviceSupport(github, core, context, zhcDir) { const issue = context.payload.issue; // Hide previous bot comments const comments = await github.rest.issues.listComments({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number, }); for (const comment of comments.data) { if (comment.user.type === "Bot" && comment.user.login === "github-actions[bot]") { await github.graphql(mutation { minimizeComment(input: {subjectId: "${comment.node_id}", classifier: OUTDATED}) { clientMutationId }}); } } // Check if Tuya manufacturer name is already supported. const tuyaManufacturerNameRe = /'"['"]/g; const tuyaManufacturerNames = Array.from(issue.body.matchAll(tuyaManufacturerNameRe), (m) => [m[1], m[2]]); if (tuyaManufacturerNames.length > 0) { for (const [fullName, partialName] of tuyaManufacturerNames) { const fullMatch = (() => { try { return execSync(grep -r --include="*.ts" "${fullName}" "${zhcDir}", {encoding: "utf8"}); } catch { return undefined; } })(); if (fullMatch) { await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number, body: 👋 Hi there! The Tuya device with manufacturer name \${fullName}` is already supported in the latest dev branch.See this guide on how to update, after updating you can remove your external converter.In case you created the external converter with the goal to extend or fix an issue with the out-of-the-box support, please submit a pull request.For instructions on how to create a pull request see the docs.If you need help with the process, feel free to ask here and we'll be happy to assist., }); await github.rest.issues.update({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number, state: "closed", }); return; } const partialMatch = (() => { try { return execSync(grep -r --include="*.ts" "${partialName}" "${zhcDir}", {encoding: "utf8"}); } catch { return undefined; } })(); if (partialMatch) { const candidates = Array.from(partialMatch.matchAll(tuyaManufacturerNameRe), (m) => m[1]); await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number, body: 👋 Hi there! A similar Tuya device of which the manufacturer name also ends with `${partialName}` is already supported.This means the device can probably be easily be supported by re-using the existing converter.I found the following matches: ${candidates.map((c) => \${c}`).join(", ")}Try to stop Z2M, change all occurrences of \${fullName}` in the `data/database.db` to one of the matches above and start Z2M.Let us know if it works so we can support this device out-of-the-box!, }); return; } } } else { // Check if zigbee model is already supported. const zigbeeModelRe = /zigbeeModel: \[['"](.+)['"]\]/g; const zigbeeModels = Array.from(issue.body.matchAll(zigbeeModelRe), (m) => m[1]); if (zigbeeModels.length > 0) { for (const zigbeeModel of zigbeeModels) { const fullMatch = (() => { try { return execSync(grep -r --include="*.ts" '"${zigbeeModel}"' "${zhcDir}", {encoding: "utf8"}); } catch { return undefined; } })(); if (fullMatch) { await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number, body: 👋 Hi there! The device with zigbee model `${zigbeeModel}` is already supported in the latest dev branch.Se...
  |   -- | --

@FuzzysTodd FuzzysTodd left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

please show todd the changessss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Set up Copilot instructions

2 participants