LVGL Switch widget color

Hi all, I am developing an LVGL interface for a Waveshare screen to the Bambu Home assistant integration for my Bambu P1S 3D printer. The supplied Bambu control screen isn’t very good but the home assistant integration provides lots of access. I am trying to keep to a theme and would like to change the blue color of an activated LVGL switch from the default blue to something else but whatever I do it stays stubbornly blue as shown below.

The documentation seems to suggest this should be able to set under the indicator section of the switch but doesn’t appear to work, I have tried a few different combinations or bg_color, arc_color and text_color but nothing seems to work. Here is the relevant bit.

	- switch:
		x: 0
		y: 320
		id: SwitchControl1FanAux
		bg_color: ${BambuGreyText}
		align: TOP_MID
		indicator:
		  bg_color: ${BambuGreen}
		on_click:
		  then:
			- homeassistant.action:
				action: fan.toggle
				data:
				  entity_id: ${PrinterFanAuxControl} 

I am doing most of the development in SDL2 with occasional verifying it on the waveshare screen. It isn’t the most critical of things but just wondering if something I’m doing wrong or a bug?

Nice looking dashboard!

You didn’t specify the state you want to change the colour for.

        - switch:
            id: lv_switch
            indicator:
              checked:
                bg_color: 0xFF0000

Thanks Clyde, that fixed it, struggled to find that nugget of information in the documentation.

And thanks for the comments, trying to keep the panel similar to their other printer which has a much better display, having to go off pictures on the Internet though. One thing I have learnt about LVGL is that - obj are your friends!

Another poor photo picture from the Waveshare itself as online images don’t work in SDL2 and I use this to download an image of the object being printed. Still a lot of work to do, next on the list combine data from a HA fan speed sensor modify it and then change the value via an HA homeassitant.action.

Andy

online_image does work on host, what doesn’t is the http_request it depends on, but you can use this PR for now.

Thanks, I knew there was something that didn’t, not a big deal it is only used for one image used once. I have 3 yaml files, 1 specific to the Waveshare, 1 specific to the host and then a common one that has the majority of sensors, lvgl, scripts etc, makes the development a bit easier. I’ll give it a go though will test your PR out.

Really appreciate the help and support and the work you have put into lvgl.

Andy

Edit - Tried your PR there was a warning during compile but works, have raised a comment with details on Github though the formatting of my comment has gone a bit strange.