diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 2fb80561f..db4e3dc95 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -26,16 +26,17 @@ jobs: with: submodules: recursive - name: Update SDKs if required - run: make update-submodules + run: make update-submodules - name: Semantic Release id: semantic - uses: cycjimmy/semantic-release-action@v2 + uses: cycjimmy/semantic-release-action@v3 with: dry_run: true - semantic_version: 18 + semantic_version: 19 extra_plugins: | @semantic-release/changelog @semantic-release/git + conventional-changelog-conventionalcommits env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set outputs @@ -102,7 +103,7 @@ jobs: name: Semantic Release Images and Artifacts runs-on: ubuntu-latest needs: [ refs, build ] - if: always() && needs.refs.outputs.new_release == 'true' && github.ref == 'refs/heads/main' + if: always() && needs.refs.outputs.new_release == 'true' && (github.ref == 'refs/heads/main' || github.ref_name == 'alpha') steps: - name: Source checkout uses: actions/checkout@v2 @@ -113,13 +114,14 @@ jobs: path: output/${{ needs.refs.outputs.version }} - name: Run Semantic Release id: semantic - uses: cycjimmy/semantic-release-action@v2 + uses: cycjimmy/semantic-release-action@v3 with: dry_run: false - semantic_version: 18 + semantic_version: 19 extra_plugins: | @semantic-release/changelog @semantic-release/git + conventional-changelog-conventionalcommits env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Echo Semantic Release Versions diff --git a/.releaserc.yaml b/.releaserc.yaml index c67671d9c..b787676af 100644 --- a/.releaserc.yaml +++ b/.releaserc.yaml @@ -1,5 +1,7 @@ branches: - 'main' + - name: 'alpha' + prerelease: true preset: "angular" tagFormat: "${version}" plugins: @@ -40,34 +42,112 @@ generateNotes: - "perf" - "fix" commitsSort: "header" - types: - - type: "feat" - - section: "Features" - # Tracked bug fix with a hotfix branch - - type: "hotfix" - - section: "Bug Fixes" - # Uninmportent fix (CI testing, etc) - - type: "fix" - - section: "Bug Fixes" - - type: "chore" - - section: "Bug Fixes" - - type: "docs" - - hidden: true - - type: "doc" - - hidden: true - - type: "style" - - hidden: true - - type: "refactor" - - hidden: true - - type: "perf" - - hidden: true - - type: "test" - - hidden: true - presetConfig: true + mainTemplate: | + {{> header}} + + {{#if noteGroups}} + {{#each noteGroups}} + + ### ⚠ {{title}} + + {{#each notes}} + * {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}} + {{/each}} + {{/each}} + {{/if}} + {{#each commitGroups}} + + {{#if title}} + ### {{title}} + + {{/if}} + {{#each commits}} + {{> commit root=@root}} + {{/each}} + + {{/each}} + + {{> footer}} + headerPartial: | + ## OpenBK7231T/OpenBeken release {{version}} + + OpenBK7231T/OpenBeken is a Tasmota/Esphome replacement for new Tuya modules featuring MQTT and Home Assistant compatibility. This repository is named OpenBK7231T_App, but now it's a multiplatform app, supporting build for multiple separate chips: + + - BK7231T (WB3S, WB2S, WB2L, etc) + - BK7231N (CB2S, CB2L, WB2L_M1, etc) + - T34 (T34 is based on BK7231N) + - XR809 (XR3, etc) + - BL602 + - W800 (W800-C400, WinnerMicro WiFi & Bluetooth), W801 + + footerPartial: | + {{#if noteGroups}} + {{#each noteGroups}} + + ### {{title}} + + {{#each notes}} + * {{text}} + {{/each}} + {{/each}} + {{/if}} + + ### Assets + Refer to the following table for the usage of the various assests included in this release + | Platform | Usage | Filename | + | --- | --- | --- | + | BK7231T | OTA Update | [OpenBK7231T_{{version}}.rbl]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenBK7231T_{{version}}.rbl) | + | BK7231T | CCtr Flash | [OpenBK7231T_UG_{{version}}.bin]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenBK7231T_UG_{{version}}.bin) | + | BK7231T | UART Flash | [OpenBK7231T_UA_{{version}}.bin]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenBK7231T_UA_{{version}}.bin) | + | BK7231N | OTA Update | [OpenBK7231N_{{version}}.rbl]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenBK7231N_{{version}}.rbl) | + | BK7231N | CCtr Flash | [OpenBK7231N_UG_{{version}}.bin]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenBK7231N_UG_{{version}}.bin) | + | BK7231N | UART Flash | [OpenBK7231N_QIO_{{version}}.bin]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenBK7231N_QIO_{{version}}.bin) | + | XR809 | | [OpenXR809_{{version}}.img]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenXR809_{{version}}.img) | + | BL602 | UART Flash | [OpenBL602_{{version}}.bin]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenBL602_{{version}}.bin) | + | W800 | OTA Update | [OpenW800_{{version}}_ota.img]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenW800_{{version}}_ota.img) | + | W800 | UART Flash | [OpenW800_{{version}}.fls]({{host}}/{{owner}}/{{repository}}/releases/download/{{version}}/OpenW800_{{version}}.fls) | + + CCtr Flash = Tuya cloud Cutter flash + + Flashing instructions are available on the project's [README.md]({{host}}/{{owner}}/{{repository}}#readme) + preset: conventionalcommits + presetConfig: + types: + - type: "feat" + section: "Features" + # Tracked bug fix with a hotfix branch + - type: "hotfix" + section: "Bug Fixes" + # Uninmportent fix (CI testing, etc) + - type: "fix" + section: "Bug Fixes" + hidden: false + - type: "chore" + section: "Changes" + hidden: false + - type: "docs" + section: "Changes" + hidden: false + - type: "doc" + section: "Changes" + hidden: false + - type: "style" + section: "Changes" + hidden: false + - type: "refactor" + section: "Changes" + hidden: false + - type: "perf" + section: "Changes" + hidden: false + - type: "test" + section: "Changes" + hidden: false + - type: "" + section: "Changes" + hidden: false prepare: - path: "@semantic-release/git" - - path: "@semantic-release/changelog" - changelogFile: "CHANGELOG.md" publish: - path: "@semantic-release/github" addReleases: "bottom" diff --git a/README.md b/README.md index 278e0e26a..c603236da 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,12 @@ the commands above return a single ASCII string as a reply so it's easy to parse https://www.elektroda.com/rtvforum/viewtopic.php?p=20031489#20031489 +# TuyaMCU example with Tuya 5 Speed Fan Controller by TEQOOZ - BK7231T - WB3S + + Home Assistant Yaml examples. Please refer to this example: + + https://www.elektroda.com/rtvforum/topic3908093.html + # TuyaMCU WB2S "Moes House" Dimmer configuration example with Home Assistant, see here: https://www.elektroda.com/rtvforum/topic3898502.html @@ -237,7 +243,6 @@ https://www.elektroda.com/rtvforum/topic3898502.html Please refer to this step by step guide: https://www.elektroda.com/rtvforum/topic3887748.html - # ZN268131 example, a smart switch that allows you to connect a bistable button diff --git a/sdk/OpenBL602 b/sdk/OpenBL602 index dc9c0674a..633a7ef8a 160000 --- a/sdk/OpenBL602 +++ b/sdk/OpenBL602 @@ -1 +1 @@ -Subproject commit dc9c0674a8e92ddd6b56a90cf325e2186c225b7a +Subproject commit 633a7ef8a273a6e4db18e27bc0a919f3f2de2308 diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index a7a65a9f1..d6d7b07af 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -45,6 +45,7 @@ template_t g_templates [] = { { Setup_Device_Empty, "Empty"}, // BK7231N devices { Setup_Device_BK7231N_CB2S_QiachipSmartSwitch, "[BK7231N][CB2S] QiaChip Smart Switch"}, + {Setup_Device_BK7231N_KS_602_TOUCH, "[BK7231N] KS 602 Touch Switch US"}, // BK7231T devices { Setup_Device_BK7231T_WB2S_QiachipSmartSwitch, "[BK7231T][WB2S] QiaChip Smart Switch"}, { Setup_Device_TuyaWL_SW01_16A, "WL SW01 16A"}, diff --git a/src/httpserver/new_http.c b/src/httpserver/new_http.c index 6f487c03f..fa4780483 100644 --- a/src/httpserver/new_http.c +++ b/src/httpserver/new_http.c @@ -328,8 +328,13 @@ void HTTP_AddBuildFooter(http_request_t *request) { // call with str == NULL to force send. - can be binary. // supply length int postany(http_request_t *request, const char *str, int len){ +#if PLATFORM_BL602 + send(request->fd,str,len,0); + return 0; +#else int currentlen; int addlen = len; + if (NULL == str){ send(request->fd, request->reply, request->replylen, 0); request->reply[0] = 0; @@ -351,6 +356,7 @@ int postany(http_request_t *request, const char *str, int len){ request->replylen += addlen; } return (currentlen + addlen); +#endif } @@ -414,6 +420,11 @@ int HTTP_ProcessPacket(http_request_t *request) { //int bChanged = 0; char *urlStr = ""; + if (request->received == 0){ + ADDLOGF_ERROR("You gave request with NULL input"); + return 0; + } + char *recvbuf = request->received; for ( i = 0; i < sizeof(methodNames)/sizeof(*methodNames); i++){ if (http_startsWith(recvbuf, methodNames[i])){ @@ -426,6 +437,10 @@ int HTTP_ProcessPacket(http_request_t *request) { ADDLOGF_ERROR("unsupported method %7s", recvbuf); return 0; } + if (request->reply == 0){ + ADDLOGF_ERROR("You gave request with NULL buffer"); + return 0; + } if (request->method == HTTP_GET) { //ADDLOG_INFO(LOG_FEATURE_HTTP, "HTTP request\n"); @@ -499,6 +514,12 @@ int HTTP_ProcessPacket(http_request_t *request) { request->bodystart = p; request->bodylen = request->receivedLen - (p - request->received); +#if 0 + postany(request,"test",4); + return 0; +#elif 0 + return http_fn_empty_url(request); +#endif // look for a callback with this URL and method, or HTTP_ANY for (i = 0; i < numCallbacks; i++){ @@ -510,7 +531,6 @@ int HTTP_ProcessPacket(http_request_t *request) { } } } - if(http_checkUrlBase(urlStr,"")) return http_fn_empty_url(request); if(http_checkUrlBase(urlStr,"index")) return http_fn_index(request); diff --git a/src/new_builtin_devices.c b/src/new_builtin_devices.c index f589bbd30..a5157581d 100644 --- a/src/new_builtin_devices.c +++ b/src/new_builtin_devices.c @@ -429,6 +429,20 @@ void Setup_Device_BK7231N_CB2S_QiachipSmartSwitch() { CFG_Save_SetupTimer(); } + +void Setup_Device_BK7231N_KS_602_TOUCH() { + CFG_ClearPins(); + + PIN_SetPinRoleForPinIndex(17, IOR_Relay); + PIN_SetPinChannelForPinIndex(17, 1); + + PIN_SetPinRoleForPinIndex(26, IOR_Button); + PIN_SetPinChannelForPinIndex(26, 1); + + CFG_SetFlag(OBK_FLAG_BTN_INSTANTTOUCH,true); + CFG_Save_SetupTimer(); +} + void Setup_Device_BK7231T_WB2S_QiachipSmartSwitch() { CFG_ClearPins(); // Button diff --git a/src/new_pins.h b/src/new_pins.h index de351a9b4..835bcae51 100644 --- a/src/new_pins.h +++ b/src/new_pins.h @@ -227,6 +227,7 @@ void Setup_Device_DS_102_3Gang_WB3S(); void Setup_Device_BK7231T_Gosund_Switch_SW5_A_V2_1(); void Setup_Device_13A_Socket_CB2S(); void Setup_Device_Deta_Smart_Double_Power_Point_6922HA_Series2(); +void Setup_Device_BK7231N_KS_602_TOUCH(); #endif diff --git a/src/user_main.c b/src/user_main.c index 4b8558bc5..41cc356e5 100644 --- a/src/user_main.c +++ b/src/user_main.c @@ -76,7 +76,7 @@ OSStatus rtos_create_thread( beken_thread_t* thread, OSStatus err = kNoErr; - err = xTaskCreate(function, name, stack_size/sizeof(StackType_t), arg, 1, thread); + err = xTaskCreate(function, name, stack_size/sizeof(StackType_t), arg, priority, thread); /* BaseType_t xTaskCreate( TaskFunction_t pvTaskCode,