Skip to content

Commit

Permalink
Move services description into strings.json (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Dec 20, 2023
1 parent a2ed36c commit 1798a5a
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 12 deletions.
4 changes: 2 additions & 2 deletions custom_components/xiaomi_miio_fan/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/syssi/xiaomi_fan/issues",
"requirements": [
"construct==2.10.56",
"construct==2.10.68",
"python-miio>=0.5.12"
],
"version": "2023.7.0.0"
"version": "2023.12.0.0"
}
68 changes: 58 additions & 10 deletions custom_components/xiaomi_miio_fan/services.yaml
Original file line number Diff line number Diff line change
@@ -1,71 +1,119 @@
fan_set_buzzer_on:
name: Set buzzer on
description: Turn the buzzer on.
fields:
entity_id:
name: Entity ID
description: Name of the Xiaomi Mi Smart Fan entity.
example: "fan.xiaomi_smart_fan"
selector:
entity:
integration: xiaomi_miio_fan
domain: fan

fan_set_buzzer_off:
name: Set buzzer off
description: Turn the buzzer off.
fields:
entity_id:
name: Entity ID
description: Name of the Xiaomi Mi Smart Fan entity.
example: "fan.xiaomi_smart_fan"
selector:
entity:
integration: xiaomi_miio_fan
domain: fan

fan_set_child_lock_on:
name: Set child lock on
description: Turn the child lock on.
fields:
entity_id:
name: Entity ID
description: Name of the Xiaomi Mi Smart Fan entity.
example: "fan.xiaomi_smart_fan"
selector:
entity:
integration: xiaomi_miio_fan
domain: fan

fan_set_child_lock_off:
name: Set child lock off
description: Turn the child lock off.
fields:
entity_id:
name: Entity ID
description: Name of the Xiaomi Mi Smart Fan entity.
example: "fan.xiaomi_smart_fan"
selector:
entity:
integration: xiaomi_miio_fan
domain: fan

fan_set_led_brightness:
description: Set the led brightness.
name: Set LED brightness
description: Set the LED brightness.
fields:
entity_id:
name: Entity ID
description: Name of the Xiaomi Mi Smart Fan entity.
example: "fan.xiaomi_smart_fan"
selector:
entity:
integration: xiaomi_miio_fan
domain: fan
brightness:
name: Brightness
description: Brightness (0 = Bright, 1 = Dim, 2 = Off)
example: 1

fan_set_natural_mode_on:
name: Set natural mode on
description: Turn the natural mode on.
fields:
entity_id:
name: Entity ID
description: Name of the Xiaomi Mi Smart Fan entity.
example: "fan.xiaomi_smart_fan"
selector:
entity:
integration: xiaomi_miio_fan
domain: fan

fan_set_natural_mode_off:
name: Set natural mode off
description: Turn the natural mode off.
fields:
entity_id:
name: Entity ID
description: Name of the Xiaomi Mi Smart Fan entity.
example: "fan.xiaomi_smart_fan"
selector:
entity:
integration: xiaomi_miio_fan
domain: fan

fan_set_oscillation_angle:
name: Set oscillation angle
description: Set the oscillation angle.
fields:
entity_id:
name: Entity ID
description: Name of the Xiaomi Mi Smart Fan entity.
example: "fan.xiaomi_smart_fan"
selector:
entity:
integration: xiaomi_miio_fan
domain: fan
angle:
name: Angle
description: Supported values are 30, 60, 90, 120, 140 or 150 degrees.
example: 30

fan_set_delay_off:
name: Set delay off
description: Set the scheduled turn off time.
fields:
entity_id:
name: Entity ID
description: Name of the Xiaomi Mi Smart Fan entity.
example: "fan.xiaomi_smart_fan"
selector:
entity:
integration: xiaomi_miio_fan
domain: fan
delay_off_countdown:
name: Delay off countdown
description: Time in minutes. Valid values are 0, 60, 120, 180, 240, 300, 240, 300, 360, 420, 480 minutes.
example: 60
106 changes: 106 additions & 0 deletions custom_components/xiaomi_miio_fan/strings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"services": {
"fan_set_buzzer_on": {
"name": "Set buzzer on",
"description": "Turn the buzzer on.",
"fields": {
"entity_id": {
"name": "Entity ID",
"description": "Name of the Xiaomi Mi Smart Fan entity."
}
}
},
"fan_set_buzzer_off": {
"name": "Set buzzer off",
"description": "Turn the buzzer off.",
"fields": {
"entity_id": {
"name": "Entity ID",
"description": "Name of the Xiaomi Mi Smart Fan entity."
}
}
},
"fan_set_child_lock_on": {
"name": "Set child lock on",
"description": "Turn the child lock on.",
"fields": {
"entity_id": {
"name": "Entity ID",
"description": "Name of the Xiaomi Mi Smart Fan entity."
}
}
},
"fan_set_child_lock_off": {
"name": "Set child lock off",
"description": "Turn the child lock off.",
"fields": {
"entity_id": {
"name": "Entity ID",
"description": "Name of the Xiaomi Mi Smart Fan entity."
}
}
},
"fan_set_led_brightness": {
"name": "Set LED brightness",
"description": "Set the LED brightness.",
"fields": {
"entity_id": {
"name": "Entity ID",
"description": "Name of the Xiaomi Mi Smart Fan entity."
},
"brightness": {
"name": "Brightness",
"description": "Brightness (0 = Bright, 1 = Dim, 2 = Off)"
}
}
},
"fan_set_natural_mode_on": {
"name": "Set natural mode on",
"description": "Turn the natural mode on.",
"fields": {
"entity_id": {
"name": "Entity ID",
"description": "Name of the Xiaomi Mi Smart Fan entity."
}
}
},
"fan_set_natural_mode_off": {
"name": "Set natural mode off",
"description": "Turn the natural mode off.",
"fields": {
"entity_id": {
"name": "Entity ID",
"description": "Name of the Xiaomi Mi Smart Fan entity."
}
}
},
"fan_set_oscillation_angle": {
"name": "Set oscillation angle",
"description": "Set the oscillation angle.",
"fields": {
"entity_id": {
"name": "Entity ID",
"description": "Name of the Xiaomi Mi Smart Fan entity."
},
"angle": {
"name": "Angle",
"description": "Supported angles are 30, 60, 90, 120, 140 or 150 degrees."
}
}
},
"fan_set_delay_off": {
"name": "Set delay off",
"description": "Set the scheduled turn off time.",
"fields": {
"entity_id": {
"name": "Entity ID",
"description": "Name of the Xiaomi Mi Smart Fan entity."
},
"delay_off_countdown": {
"name": "Delay off countdown",
"description": "Time in minutes. Valid values are 0, 60, 120, 180, 240, 300, 240, 300, 360, 420, 480 minutes."
}
}
}
}
}

0 comments on commit 1798a5a

Please sign in to comment.