You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
603 B

3 years ago
  1. import esphome.codegen as cg
  2. import esphome.config_validation as cv
  3. from esphome.components.light.effects import register_monochromatic_effect
  4. from esphome.components.light.types import light_ns, LightEffect
  5. from esphome.const import CONF_NAME
  6. CODEOWNERS = ["@mmakaay"]
  7. CandleLightEffect = light_ns.class_("CandleLightEffect", LightEffect)
  8. CONFIG_SCHEMA = cv.Schema({})
  9. @register_monochromatic_effect(
  10. "candle",
  11. CandleLightEffect,
  12. "Candle",
  13. {
  14. },
  15. )
  16. async def candle_effect_to_code(config, effect_id):
  17. effect = cg.new_Pvariable(effect_id, config[CONF_NAME])
  18. return effect