[Feature Request] HMS Code mapping
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- api
调研方向
首先检查打印报告 payload 的 hms 数组以及提供的 Node-RED 转换代码片段。将十进制的 attr 和 code 值与链接的 Bambu HMS 代码文档进行比较;完成标准和实现位置仍需协商确定,因为 issue 没有指出项目入口点或预期的 API 形式。
由索引模型根据 Issue 内容生成。
描述
Wasn't sure where this would fit in the current layout, so I will give my findings here.
In the report print payload for all sensors (or a subset if the P1P as it does not send all unless pushall is invoked), there is the value hms with an array.
If it contains values, it is as such:
"hms": [
{
"code": "somecode",
"attr": "somecode"
},
{
"code": "somecode",
"attr": "somecode"
}
]
The codes and attributes are not recognizable at first, but can be mapped to errors. Both the code and attr are decimal numbers that when converted to Hex with Two's complement, then append the code after the attr and separate each set of 4 character with an underscore, it will be in the format of Bambu's official HMS code errors as per their website.
Note: Not all hms codes are documented yet.
Here is a snippet of how I convert them in nodered:
function DecimalHexTwosComplement(decimal) {
var size = 8;
var hexadecimal;
if (decimal >= 0) {
hexadecimal = decimal.toString(16);
while ((hexadecimal.length % size) != 0) {
hexadecimal = "" + 0 + hexadecimal;
}
return hexadecimal;
} else {
hexadecimal = Math.abs(decimal).toString(16);
while ((hexadecimal.length % size) != 0) {
hexadecimal = "" + 0 + hexadecimal;
}
var output = '';
for (var i = 0; i < hexadecimal.length; i++) {
output += (0x0F - parseInt(hexadecimal[i], 16)).toString(16);
}
output = (0x01 + parseInt(output, 16)).toString(16);
return output;
}
}
let template = [];
if(msg.payload.print.hms != undefined){
for (var hms_code of msg.payload.print.hms) {
var attr = DecimalHexTwosComplement(hms_code.attr);
var code = DecimalHexTwosComplement(hms_code.code);
let full_code = (attr + code).replace(/(.{4})/g, "$1_");
full_code = full_code.substring(0, full_code.length - 1);
let url = "https://wiki.bambulab.com/en/x1/troubleshooting/hmscode/"+full_code;
template.push({"code": "HMS_"+full_code, "url": url});
}
msg.payload.print.hms = template;
}
- 主要语言
- 没有语言数据
- 星标
- 696
- 派生
- 99
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Doridian/OpenBambuAPI 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
Doridian/OpenBambuAPI#51 · 8 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
Doridian/OpenBambuAPI#10 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 70/100
Doridian/OpenBambuAPI#72 ·
-
难度 3/5 1-2 天 新手友好度 38/100
Doridian/OpenBambuAPI#59 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 38/100
Doridian/OpenBambuAPI#56 · 1 条评论 ·
查看 Doridian/OpenBambuAPI 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
BC remittance upload: a claim MSP refused (S03) is saved with a blank status instead of refused (F)未关闭type: bug
难度 2/5 1-3 小时 新手友好度 88/100
carlos-emr/carlos#4933 ·
维护者通常 1 天内回复
-
Authentication / Authorization Feature: Volunteer
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
Emanuele-web04/remodex#203 ·
维护者通常 1 天内回复
-
area:protocol bug
难度 2/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复