val in self.channels.items() can be float
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- embedded-iot
调研方向
从 _Controller.py 中的通道值循环开始,检查 self.channels.items() 中的值如何传递到 _transmit。重现会产生 float 的恒定流情况,然后验证所选处理方式能够保留有效的 DMX 帧数据,并防止转换为 bytearray 时失败。
由索引模型根据 Issue 内容生成。
描述
Hi fellow,
thanks a looot for your library. Real nice work.
I ran into an issue (can't tell you the origin), but by using a constant stream following line in _Controller.py might create a float, which later on will crash the program:
# Get all channels values
for key, val in self.channels.items():
# If channel in frame
if key - first < len(self.__frame):
self.__frame[key - first] = int(val[0])`
i placed an int() around the val[0]. Not sure if that's in general a good idea.
but it fixed the issue, that otherwise at this call would break the runtime.
def _transmit(self, frame: List[int], first: int):
# Convert to a bytearray and pad the start of the frame
# We're transmitting direct DMX data here, so a frame must start at channel 1, but can end early
try:
data = bytearray(([0] * (first - 1)) + frame)
# The first byte in the type, and is `0` for normal DMX data
data.insert(0, 0)
# Write
self.__device.send_break(100e-6)
sleep(10e-6)
self.__device.write(data)
except:
print("bad request")`
```
as you see I made a try / except for myself.
- 主要语言
- Python
- 星标
- 143
- 派生
- 23
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MattIPv4/PyDMXControl 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
MattIPv4/PyDMXControl#60 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
MattIPv4/PyDMXControl#58 ·
-
难度 5/5 一周以上 新手友好度 25/100
MattIPv4/PyDMXControl#56 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 18/100
MattIPv4/PyDMXControl#52 · 5 条评论 ·
-
Custom Channels 未关闭
难度 4/5 3-5 天 新手友好度 35/100
MattIPv4/PyDMXControl#51 · 3 条评论 ·
查看 MattIPv4/PyDMXControl 的全部 Issue
相似的 Issue
-
agent-ready documentation needs-triage
难度 1/5 1-3 小时 新手友好度 88/100
-
documentation
难度 1/5 1 小时以内 新手友好度 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
instance instance add
难度 1/5 1 小时以内 新手友好度 72/100
searxng/searx-instances#939 · 1 条评论 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100