muxa / esphome-state-machine

ESPHome State Machine component
MIT License
75 stars 7 forks source link

Light operation on the intial state on_set have no effect #39

Open majkrzak opened 1 year ago

majkrzak commented 1 year ago

I'm trying to set light status in on_set of the initial state, but it does not have effect.

  - light.turn_on:
      id: status
      transition_length: 0s
      brightness: 25%
      red: 100%
      green: 100%
      blue: 100%
light:
- id: status
  platform: neopixelbus
  restore_mode: ALWAYS_ON
  variant: SK6812
  num_leds: 1
  default_transition_length: 0s
  pin: GPIO27

Probably initial state transition happens to early. In my logs I see it way before setup finishes and config is dumped. Light transition is visible in logs but ignored:

[21:23:06][D][light:035]: 'status' Setting:
[21:23:06][D][light:040]:   Color mode: RGB
[21:23:06][D][light:046]:   State: ON
[21:23:06][D][state_machine:085]: State set to STARTING
[21:23:06][D][light:035]: 'status' Setting:
[21:23:06][D][light:050]:   Brightness: 25%
[21:23:06][D][light:058]:   Red: 100%, Green: 100%, Blue: 100%