Skip to content

Feat: 支持设备 outlet(插座/开机卡)#67

Merged
sky130 merged 2 commits into
masterfrom
device-outlet
May 22, 2026
Merged

Feat: 支持设备 outlet(插座/开机卡)#67
sky130 merged 2 commits into
masterfrom
device-outlet

Conversation

@sky130
Copy link
Copy Markdown
Owner

@sky130 sky130 commented May 22, 2026

No description provided.

sky130 added 2 commits May 23, 2026 01:26
- **项目结构**: 明确了多模块 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` 等电量相关属性。
@sky130 sky130 marked this pull request as ready for review May 22, 2026 17:42
@sky130 sky130 merged commit 186f7c5 into master May 22, 2026
1 check passed
@sky130 sky130 mentioned this pull request May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant