From d3dbe70e153f81ea0bc4e823bd99fbc41c7c9dc4 Mon Sep 17 00:00:00 2001 From: xyzroe Date: Fri, 24 May 2024 19:52:42 +0300 Subject: [PATCH] 20240524 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add a workflow for expressing gratitude after the merge - Try to fix ZB FW value is 0 #10 - Fix CZ language typo Thanks to @leroyloren πŸš€ #25 - Fix warning in HA about the missing attribute #15 - Renamed cs.json to cz.json to to comply with standard names accepted in i18next - Add ČeΕ‘tina translation. Thanks to @leroyloren πŸš€ #19 - Fixed type error on login page Thanks to @mercenaruss πŸš€ #18 - Add TubeZB config option. Thanks to @mercenaruss πŸš€ #17 --- .github/workflows/merge_comment.yml | 28 ++++++++++++++++++++++++++++ src/mqtt.cpp | 8 ++++++-- src/zb.cpp | 13 +++++++++++-- 3 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/merge_comment.yml diff --git a/.github/workflows/merge_comment.yml b/.github/workflows/merge_comment.yml new file mode 100644 index 0000000..b3e427d --- /dev/null +++ b/.github/workflows/merge_comment.yml @@ -0,0 +1,28 @@ +name: Add merge comment + +on: + pull_request: + types: [closed] + +jobs: + add-merge-comment: + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true + steps: + - name: Add comment to merged pull request + uses: actions/github-script@v6 + with: + script: | + const pull_request = context.payload.pull_request; + const author = pull_request.user.login; + const issue_number = pull_request.number; + const body = `Thanks @${author} πŸš€`; + + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue_number, + body: body + }); + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/mqtt.cpp b/src/mqtt.cpp index b5f8f63..498faf8 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -67,8 +67,12 @@ String getWlanIp() } String getWlanSsid() -{ - return String(WiFi.SSID()); +{ + String ssid = WiFi.SSID(); + if (ssid.isEmpty()) { + ssid = "-"; + } + return ssid; } String getWlanRssi() diff --git a/src/zb.cpp b/src/zb.cpp index 99cdb02..347d494 100644 --- a/src/zb.cpp +++ b/src/zb.cpp @@ -43,8 +43,17 @@ bool zbFwCheck() } else { - printLogMsg(tag_ZB + " fw: unknown!"); - return false; + delay(250); + if (CCTool.checkFirmwareVersion()) + { + printLogMsg(tag_ZB + " fw: " + String(CCTool.chip.fwRev)); + return true; + } + else + { + printLogMsg(tag_ZB + " fw: unknown!"); + return false; + } } }