Skip to content

Commit

Permalink
update based on super linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed May 13, 2024
1 parent 1e65ada commit b5b4998
Show file tree
Hide file tree
Showing 35 changed files with 159 additions and 62 deletions.
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/1-issue_zh-cn.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
---
name: 错误报告
description: 集成或实体无法正常工作
labels: ["bug"]
body:
- type: input
attributes:
label: HA版本
placeholder: 2023.4.2
placeholder: 2024.5.3
- type: input
validations:
required: true
attributes:
label: 集成版本
placeholder: 0.3.18
placeholder: 0.3.23
- type: input
validations:
required: true
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/2-issue_en.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Bug report
description: Intergration or entity is not working right
labels: ["bug"]
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/3-enhancement_zh-cn.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: 新功能请求
description: 请求增加新设备支持或请求为已有设备增加新的功能
labels: ["enhancement"]
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/4-enhancement_en.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Enhancement
description: New feature or new device support request
labels: ["enhancement"]
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
---
blank_issues_enabled: true
10 changes: 4 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
## PR Brief Description:
# PR Brief Description

## Reason & Detail

## Changes Detail or Reason:


## Releted issue:
## Releted issue

fix #X

<!--
please change X to issue id, it will auto close this issue once PR closed
Example:
Example:
fix #1
it will auto close issue #1 once PR closed
-->
3 changes: 3 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: "CodeQL"

on:
Expand All @@ -8,6 +9,8 @@ on:
# schedule:
# - cron: "42 8 * * 6"

permissions: { }

jobs:
analyze:
name: Analyze
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Linter

on:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
name: Release

on:
release:
types: [released]

permissions: { }

defaults:
run:
shell: bash
Expand Down Expand Up @@ -90,4 +93,4 @@ jobs:
with:
files: artifacts/midea_ac_lan.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
19 changes: 10 additions & 9 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@

---
name: HACS Validation

on:
pull_request:
push:
# schedule:
# - cron: "0 0 * * *"

permissions: { }

jobs:
validate:
name: HASS and Hassfest Validation
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@v4"

- name: HACS Action
uses: hacs/action@main
with:
category: "integration"
- name: HACS Action
uses: hacs/action@main
with:
category: "integration"

- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"
- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"
6 changes: 3 additions & 3 deletions custom_components/midea_ac_lan/midea/core/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ async def list_appliances(self, home_id) -> dict | None:
"sn": self._security.aes_decrypt(appliance.get("sn")) if appliance.get("sn") else "",
"sn8": appliance.get("sn8", "00000000"),
"model_number": model_number,
"manufacturer_code":appliance.get("enterpriseCode", "0000"),
"manufacturer_code": appliance.get("enterpriseCode", "0000"),
"model": appliance.get("productModel"),
"online": appliance.get("onlineStatus") == "1",
}
Expand Down Expand Up @@ -464,7 +464,7 @@ async def list_appliances(self, home_id) -> dict | None:
"sn": self._security.aes_decrypt(appliance.get("sn")) if appliance.get("sn") else "",
"sn8": "",
"model_number": model_number,
"manufacturer_code":appliance.get("enterpriseCode", "0000"),
"manufacturer_code": appliance.get("enterpriseCode", "0000"),
"model": "",
"online": appliance.get("onlineStatus") == "1",
}
Expand Down Expand Up @@ -624,7 +624,7 @@ async def list_appliances(self, home_id) -> dict | None:
"sn": appliance.get("sn"),
"sn8": "",
"model_number": model_number,
"manufacturer_code":appliance.get("enterpriseCode", "0000"),
"manufacturer_code": appliance.get("enterpriseCode", "0000"),
"model": "",
"online": appliance.get("onlineStatus") == "1",
}
Expand Down
14 changes: 10 additions & 4 deletions doc/AC.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Air Conditioner

## Features

- Supports target temperature
- Supports run mode
- Supports fan mode
Expand All @@ -8,6 +10,7 @@
- Supports build-in fresh air system

### Supported Run-Modes

- Comfort Mode
- ECO Mode
- Boost Mode
Expand All @@ -22,16 +25,18 @@

- Power consumption analysis method (1 by default)

There are 3 different methods to analyze the power consumption of an AC, but I don’t know which is right for your device.
If the power consumption data looks incorrect, try another method and see if they are correct.
There are 3 different methods to analyze the power consumption of an AC, but I don’t know which is right for your device.
If the power consumption data looks incorrect, try another method and see if they are correct.
The options include 1, 2, and 3.

```json
{"power_analysis_method": 2}
```

## Entities

### Default entity

| EntityID | Class | Description |
|----------------------------|---------|----------------|
| climate.{DEVICEID}_climate | climate | Climate entity |
Expand Down Expand Up @@ -89,6 +94,7 @@ Set the attribute of appliance. Service data:
| value | Range 1 to 100 or "auto" |

Example

```yaml
service: midea_ac_lan.set_attribute
data:
Expand All @@ -103,4 +109,4 @@ data:
device_id: XXXXXXXXXXXX
attribute: fan_speed
value: auto
```
```
11 changes: 8 additions & 3 deletions doc/C3.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Heat Pump Wi-Fi Controller

## Features

- Supports target temperature
- Supports run mode

## Entities

### Default entity

| EntityID | Class | Description |
|--------------------------------------|--------------|----------------------|
| climate.{DEVICEID}_climate_zone1 | climate | Zone1 climate entity |
Expand All @@ -20,7 +24,7 @@
| binary_sensor.{DEVICEID}_zone1_room_temp_mode | binary_sensor | Zone1 Room Temperature Mode |
| binary_sensor.{DEVICEID}_zone2_room_temp_mode | binary_sensor | Zone2 Room Temperature Mode |
| binary_sensor.{DEVICEID}_status_dhw | binary_sensor | DHW Status |
| binary_sensor.{DEVICEID}_status_tbh | binary_sensor | TBH Status |****
| binary_sensor.{DEVICEID}_status_tbh | binary_sensor | TBH Status |
| binary_sensor.{DEVICEID}_status_ibh | binary_sensor | IBH Status |
| binary_sensor.{DEVICEID}_status_heating | binary_sensor | Heating Status |
| sensor.{DEVICEID}_error_code | sensor | Error Code |
Expand All @@ -33,7 +37,7 @@
| switch.{DEVICEID}_eco_mode | switch | ECO Mode |
| switch.{DEVICEID}_fast_dhw | switch | Fast DHW |
| switch.{DEVICEID}_silent_mode | switch | Silent Mode |
| switch.{DEVICEID}_tbh | switch | TBH |
| switch.{DEVICEID}_tbh | switch | TBH |
| switch.{DEVICEID}_zone1_curve | switch | Zone1 Curve |
| switch.{DEVICEID}_zone2_curve | switch | Zone2 Curve |
| switch.{DEVICEID}_zone1_power | switch | Zone1 Power |
Expand All @@ -54,10 +58,11 @@ Set the attribute of appliance. Service data:
| value | true or false |

Example

```yaml
service: midea_ac_lan.set_attribute
data:
device_id: XXXXXXXXXXXX
attribute: zone1_curve
value: true
```
```
9 changes: 7 additions & 2 deletions doc/C3_hans.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# 热泵空调Wi-Fi线控器

## 特性

- 支持目标温度设定
- 支持运行模式设定

## 生成实体

### 默认生成实体

| 实体ID | 类型 | 描述 |
|--------------------------------------|--------------|----------|
| climate.{DEVICEID}_climate_zone1 | climate | 区域1恒温器实体 |
Expand All @@ -20,7 +24,7 @@
| binary_sensor.{DEVICEID}_zone1_room_temp_mode | binary_sensor | Zone1 Room Temperature Mode | 区域1室温模式 |
| binary_sensor.{DEVICEID}_zone2_room_temp_mode | binary_sensor | Zone2 Room Temperature Mode | 区域2室温模式 |
| binary_sensor.{DEVICEID}_status_dhw | binary_sensor | DHW Status | DHW状态 |
| binary_sensor.{DEVICEID}_status_tbh | binary_sensor | TBH Status | TBH状态 |
| binary_sensor.{DEVICEID}_status_tbh | binary_sensor | TBH Status | TBH状态 |
| binary_sensor.{DEVICEID}_status_ibh | binary_sensor | IBH Status | IBH状态 |
| binary_sensor.{DEVICEID}_status_heating | binary_sensor | Heating Status | 加热状态 |
| sensor.{DEVICEID}_error_code | sensor | Error Code | 错误码 |
Expand Down Expand Up @@ -54,10 +58,11 @@
| value | true 或 false |

示例

```yaml
service: midea_ac_lan.set_attribute
data:
device_id: XXXXXXXXXXXX
attribute: zone1_curve
value: true
```
```
10 changes: 7 additions & 3 deletions doc/E2.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Electric Water Heater

## Features
- Supports target temperature

- Supports target temperature

## Customize

- Set the protocol of device ("auto" by default).
There are 2 different protocol version to control Electric Water Heater, "old protocol" or "new protocol".
If you can't control your device, try change this item and see if it works.
Expand All @@ -14,7 +16,9 @@ The options include true, false, and "auto".
```

## Entities

### Default entity

| EntityID | Class | Description |
|--------------------------------------|--------------|---------------------|
| water_heater.{DEVICEID}_water_heater | water_heater | Water heater entity |
Expand All @@ -35,7 +39,6 @@ The options include true, false, and "auto".

## Services


### midea_ac_lan.set_attribute

[![Service](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=midea_ac_lan.set_attribute)
Expand All @@ -49,10 +52,11 @@ Set the attribute of appliance. Service data:
| value | true or false |

Example

```yaml
service: midea_ac_lan.set_attribute
data:
device_id: XXXXXXXXXXXX
attribute: variable_heating
value: true
```
```
11 changes: 7 additions & 4 deletions doc/E3.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
# Gas Water Heater

## Features
- Supports target temperature

- Supports target temperature

## Customize

- Set the temperature precision for whole or halves (false for whole and true for halves, default by false)

If the temperature value displayed on your water heater is twice the actual value, please set this value to true.

```json
{"precision_halves": true}
```

## Entities

### Default entity

| EntityID | Class | Description |
|--------------------------------------|--------------|---------------------|
| water_heater.{DEVICEID}_water_heater | water_heater | Water heater entity |
Expand All @@ -33,7 +36,6 @@

## Services


### midea_ac_lan.set_attribute

[![Service](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=midea_ac_lan.set_attribute)
Expand All @@ -47,10 +49,11 @@ Set the attribute of appliance. Service data:
| value | true or false |

Example

```yaml
service: midea_ac_lan.set_attribute
data:
device_id: XXXXXXXXXXXX
attribute: smart_volume
value: true
```
```
Loading

0 comments on commit b5b4998

Please sign in to comment.