Feat: 支持设备 outlet(插座/开机卡)#67
Merged
Merged
Conversation
- **项目结构**: 明确了多模块 Gradle 架构及各模块职能(`app`、`miot-api`、`miwu-support` 等)。 - **构建与测试**: 规定使用 JDK 21,并列出了编译、打包及运行单元测试/集成测试的标准命令。 - **代码规范**: 确立了 Kotlin 编程习惯、命名风格(PascalCase/camelCase/snake_case)以及资源文件命名约定。 - **提交流程**: 规范了 Commit Message 格式(如 `Feat:`、`Fix:`、`Refactor:` 前缀)及 Pull Request 的描述要求。 - **安全准则**: 强调严禁提交敏感凭证、Token 及本地环境配置文件。
- **新增设备支持**:
- 新增 `Outlet` (插座) 设备类,配置了 `SwitchBar` 和 `Text` 组件。
- **优化单位处理逻辑 (`ValueUnit`)**:
- 在 `ValueUnit` 中新增 `fromProperty` 兜底方法,支持根据属性名(如功耗、电流、电压、温湿度)自动推断并返回对应的单位(如 `kwh`, `A`, `V`, `°C`, `%`)。
- **改进 `Text` 组件**:
- **TextWrapper**: 优化单位显示逻辑,优先使用配置单位,若为空则通过 `ValueUnit.fromProperty` 获取。
- **属性绑定**: 扩展 `Text` 组件以支持绑定 `power-consumption`、`electric-current` 和 `voltage` 等电量相关属性。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.