Skip to content

Commit

Permalink
add github superlinter and auto release job
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed May 13, 2024
1 parent e4c22cf commit fd736a8
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 32 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint

on:
push:
branches:
- master
pull_request:
branches:
- master

permissions: { }

jobs:
build:
name: Lint
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0

- name: Super-linter
uses: super-linter/super-linter@v6.4.1 # x-release-please-version
env:
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
93 changes: 93 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Release

on:
release:
types: [released]

defaults:
run:
shell: bash

jobs:
generate_zip:
name: Generate release zip
runs-on: [ubuntu-latest]
timeout-minutes: 60
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
clean: true

- name: Show Output Directory For Debug Purpose
run: |
apt update && apt install zip || exit 1
echo “show runner hostname”
hostname
echo “show runner user”
whoami
echo “show runner pwd”
pwd
echo “show runner kernel”
uname -a
echo “show runner pwd file list”
ls
ls -alht custom_components/midea_ac_lan/ || exit 1
echo "show manifest.json for debug"
cat custom_components/midea_ac_lan/manifest.json || exit 1
sudo mkdir -p /github/workspace/artifacts || exit 1
sudo chown -R $(id -u):$(id -g) /github/workspace/artifacts || exit 1
sudo chmod -R 755 /github/workspace/artifacts || exit 1
cd custom_components/midea_ac_lan/ || exit 1
zip -r ../midea_ac_lan.zip ./* || exit 1
cp ../midea_ac_lan.zip /github/workspace/artifacts/midea_ac_lan.zip || exit 1
ls -alht /github/workspace/artifacts/ || exit 1
shell: bash

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: midea_ac_lan.zip
path: /github/workspace/artifacts

upload_release:
needs: generate_zip
name: Publish release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:

- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: midea_ac_lan.zip
merge-multiple: true

- name: Display Structure of Artifacts Files
run: ls -R

- name: Show Working Directory For Debug Purpose
run: |
echo “show runner hostname”
hostname
echo “show runner user”
whoami
echo “show runner pwd”
pwd
echo “show runner kernel”
uname -a
echo “show runner pwd file list”
ls
ls -alht
echo “show runner artifacts”
ls -alht artifacts || exit 0
echo "github.ref: ${{github.ref}} "
- name: Upload images to Release Asset
uses: softprops/action-gh-release@v2
with:
files: artifacts/midea_ac_lan.zip
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
46 changes: 30 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Midea AC LAN

[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/hacs/integration)
[![Donate](https://img.shields.io/badge/donate-BuyMeCoffee-yellow.svg)](https://www.buymeacoffee.com/georgezhao2010)
[![Stable](https://img.shields.io/github/v/release/CyrielRct/midea_ac_lan)](https://github.com/CyrielRct/midea_ac_lan/releases/latest)
[![Super-Linter](https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/<WORKFLOW_FILE_NAME>/badge.svg)](https://github.com/marketplace/actions/super-linter)

> :warning: **This is a fork of Midea_ac_lan done by Georgezhao **: As the project is in a vegetative state we have done a fork and merged some pending fixes.
> :warning: **This is a fork of midea_ac_lan done by Georgezhao**: As the project is in a vegetative state we have done a fork and merged some pending fixes.
I'm trying to get in touch with the maintainer at the moment to find a solution, and at the same time we're looking for people available to maintain the project, which is actively used by the community. please contact me if you can help !

English | [简体中文](README_hans.md)
Expand All @@ -22,13 +24,13 @@ Thanks also to [@NeoAcheron](https://github.com/NeoAcheron/midea-ac-py).

***❗Note: Home Assistant 2023.1 or higher required for this integration***

# Supported brands
## Supported brands

![ariston](brands/ariston.png) ![beverly](brands/beverly.png) ![bugu](brands/bugu.png) ![carrier](brands/carrier.png) ![colmo](brands/colmo.png) ![comfee](brands/comfee.png) ![electrolux](brands/electrolux.png) ![invertor](brands/invertor.png) ![littleswan](brands/littleswan.png) ![midea](brands/midea.png) ![netsu](brands/netsu.png) ![ProBreeze](brands/probreeze.png) ![rotenso](brands/rotenso.png) ![toshiba](brands/toshiba.png) ![vandelo](brands/vandelo.png) ![wahin](brands/wahin.png)

And more.

# Supported appliances
## Supported appliances

| Type | Name | Documents |
|------|----------------------------|--------------------|
Expand Down Expand Up @@ -67,12 +69,14 @@ And more.
| FC | Air Purifier | [FC.md](doc/FC.md) |
| FD | Humidifier | [FD.md](doc/FD.md) |

# Installation
Search 'Midea AC LAN' in HACS and install, or copy all files in `custom_components/midea_ac_lan` from [Latest Release](https://github.com/georgezhao2010/midea_ac_lan/releases/latest) to your `/custom_components/midea_ac_lan` in Home Assistant manually.
## Installation

Search 'Midea AC LAN' in HACS and install, or copy all files in `custom_components/midea_ac_lan` from [Latest Release](https://github.com/georgezhao2010/midea_ac_lan/releases/latest) to your `/custom_components/midea_ac_lan` in Home Assistant manually.

Restart Home Assistant.

# Add device
## Add device

***❗Note: First, set a static IP address for your appliance in the router, in case the IP address of the appliance changes after set-up.***

After installation, search and add component Midea AC LAN in Home Assistant integrations page.
Expand All @@ -83,15 +87,18 @@ Or click [![Configuration](https://my.home-assistant.io/badges/config_flow_start

After the account is configured, Click 'ADD DEVICE' once more to add new device. You could repeat the above action to add multiple devices.

## Discover automatically
### Discover automatically

Using this option, the component could auto-discover and list Midea M-Smart appliances in network or specified IP address, select one and add it in.

You can also use an IP address to search within a specified network, such as `192.168.1.255`.

***❗Note: Discovery automatically requires your appliances and your Home Assistant must be in the same sub-network. Otherwise, devices may not be auto-discovered. Check this by yourself.***

## Configure manually
### Configure manually

If you already know following information, you could add the appliance manually.

- Appliance code
- Appliance type (one of [Supported appliances](README.md#supported-appliances))
- IP address
Expand All @@ -100,52 +107,59 @@ If you already know following information, you could add the appliance manually.
- Token
- Key

## List all appliances only
### List all appliances only

Using this option, you can list all discoverable Midea M-Smart devices on the network, along with their IDs, types, SNs, and other information.

***❗Note: For certain reasons, not all supported devices may be listed here.***

# Configure
## Configure

Configure can be found in `Settings -> Devices & Services -> Midea AC LAN -> Devices -> CONFIGURE`.
You can re-set the IP address when device IP changed.
You can also add extra sensor and switch entities or customize your own device.

## IP address
### IP address

Set the IP address of device. You can reset this when your device IP is changed.

## Refresh interval
### Refresh interval

Set the interval for actively refreshing the status of a single device (the unit is second) (30 by default and 0 means not refresh actively)
Mostly the status update of Midea devices relies on the active information notification of the device, in which condition the status update in HA still works normally even if the refresh interval is set to be “0”. This component will also actively query the device status at regular intervals, and the default time is 30 seconds. Some devices do not have active information notifications when their status changed, so synchronization with the status in HA will be slower. If you are very concerned about the synchronization speed of the status, you can try to set a shorter status refresh interval.

***❗Note: shorter refresh interval may mean more power consumption***

## Extra sensor and switch entities
### Extra sensor and switch entities

After configuration, one of few main entity (e.g. climate entity) may be generated . If you want to make the attributes to extra sensor and switch entities, click CONFIGURE in Midea AC LAN integration card to choose (if your devices supported).

## Customize
### Customize

Some types of device have their own configuration items, if your device does not work properly, you may need to customize it. Refer to the device documentation for specific information.

The format of customizations must be JSON.

If multiple customization items need to be configured, the settings must comply with the JSON format.

Example

```json
{"refresh_interval": 15, "fan_speed": 100}
```

# Debug
## Debug

Turn on the debug log out,config in configuration.yaml

```yaml
logger:
default: warn
logs:
custom_components.midea_ac_lan: debug
```
# Support my works
## Support my works
If you like this integration, why do not you support my works by buying me a coffee?
Expand Down
Loading

0 comments on commit fd736a8

Please sign in to comment.