1
mirror of https://github.com/home-assistant/core synced 2024-08-28 03:36:46 +02:00
ha-core/homeassistant/components/fan/strings.json
Jan Bouwhuis 953a212dd6
Use ServiceValidationError for invalid fan preset_mode and move check to fan entity component (#104560)
* Use ServiceValidationError for fan preset_mode

* Use _valid_preset_mode_or_raise to raise

* Move preset_mode validation to entity component

* Fix bond fan and comments

* Fixes baf, fjaraskupan and template

* More integration adjustments

* Add custom components mock and test code

* Make NotValidPresetModeError subclass

* Update homeassistant/components/fan/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Keep bond has_action validation

* Move demo test asserts outside context block

* Follow up comment

* Update homeassistant/components/fan/strings.json

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Fix demo tests

* Remove pylint disable

* Remove unreachable code

* Update homeassistant/components/fan/__init__.py

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Use NotValidPresetModeError, Final methods

* Address comments

* Correct docst

* Follow up comments

* Update homeassistant/components/fan/__init__.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-11-29 13:56:51 +01:00

154 lines
4.3 KiB
JSON

{
"title": "Fan",
"device_automation": {
"condition_type": {
"is_on": "[%key:common::device_automation::condition_type::is_on%]",
"is_off": "[%key:common::device_automation::condition_type::is_off%]"
},
"trigger_type": {
"changed_states": "[%key:common::device_automation::trigger_type::changed_states%]",
"turned_on": "[%key:common::device_automation::trigger_type::turned_on%]",
"turned_off": "[%key:common::device_automation::trigger_type::turned_off%]"
},
"action_type": {
"toggle": "[%key:common::device_automation::action_type::toggle%]",
"turn_on": "[%key:common::device_automation::action_type::turn_on%]",
"turn_off": "[%key:common::device_automation::action_type::turn_off%]"
}
},
"entity_component": {
"_": {
"name": "[%key:component::fan::title%]",
"state": {
"off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]"
},
"state_attributes": {
"direction": {
"name": "Direction",
"state": {
"forward": "Forward",
"reverse": "Reverse"
}
},
"oscillating": {
"name": "Oscillating",
"state": {
"true": "[%key:common::state::yes%]",
"false": "[%key:common::state::no%]"
}
},
"percentage": {
"name": "Speed"
},
"percentage_step": {
"name": "Speed step"
},
"preset_modes": {
"name": "Available preset modes"
},
"preset_mode": {
"name": "Preset mode"
}
}
}
},
"services": {
"set_preset_mode": {
"name": "Set preset mode",
"description": "Sets preset mode.",
"fields": {
"preset_mode": {
"name": "Preset mode",
"description": "Preset mode."
}
}
},
"set_percentage": {
"name": "Set speed",
"description": "Sets the fan speed.",
"fields": {
"percentage": {
"name": "Percentage",
"description": "Speed of the fan."
}
}
},
"turn_on": {
"name": "[%key:common::action::turn_on%]",
"description": "Turns fan on.",
"fields": {
"percentage": {
"name": "[%key:component::fan::services::set_percentage::fields::percentage::name%]",
"description": "[%key:component::fan::services::set_percentage::fields::percentage::description%]"
},
"preset_mode": {
"name": "[%key:component::fan::services::set_preset_mode::fields::preset_mode::name%]",
"description": "[%key:component::fan::services::set_preset_mode::fields::preset_mode::description%]"
}
}
},
"turn_off": {
"name": "[%key:common::action::turn_off%]",
"description": "Turns fan off."
},
"oscillate": {
"name": "Oscillate",
"description": "Controls oscillatation of the fan.",
"fields": {
"oscillating": {
"name": "Oscillating",
"description": "Turn on/off oscillation."
}
}
},
"toggle": {
"name": "[%key:common::action::toggle%]",
"description": "Toggles the fan on/off."
},
"set_direction": {
"name": "Set direction",
"description": "Sets the fan rotation direction.",
"fields": {
"direction": {
"name": "Direction",
"description": "Direction to rotate."
}
}
},
"increase_speed": {
"name": "Increase speed",
"description": "Increases the speed of the fan.",
"fields": {
"percentage_step": {
"name": "Increment",
"description": "Increases the speed by a percentage step."
}
}
},
"decrease_speed": {
"name": "Decrease speed",
"description": "Decreases the speed of the fan.",
"fields": {
"percentage_step": {
"name": "Decrement",
"description": "Decreases the speed by a percentage step."
}
}
}
},
"selector": {
"direction": {
"options": {
"forward": "Forward",
"reverse": "Reverse"
}
}
},
"exceptions": {
"not_valid_preset_mode": {
"message": "Preset mode {preset_mode} is not valid, valid preset modes are: {preset_modes}."
}
}
}