Closed psfales closed 7 months ago
Arrows can be drawn with an "icon". I draw wind direction arrows using this method:
@psfales does this fix work for you?
Thanks for the suggestion to use the icons. That technique is working quite nicely for me.
However, I'm curious what values are returned by the state_attr('sensor.weatherman_data_tag','wm_wind_dir_4'). I found it necessary to add 22.5 degrees to my sensor value so (for example) the left-arrow (east direction) will be active from 67.5 to 112.5 degrees instead of 90 to 135 degrees
It contains the wind bearings, 0-359. I found the code elsewhere, but it seems to show the correct arrows for me. I haven’t done any thorough testing though.
67.5/45 rounds to 2. 112.49/45 rounds to 2. So they both should return “arrow-left”, without adding 22.5…?
Also found out today that the array must contain an additional “arrow-down” at the end, to handle the last “sector” from 315.1 degrees and up.
Maybe I'm the one that needs to do some more testing! When I was doing my test calculations on paper, I was (for some reason) thinking of integer division where 89/45 would be 1 and 90/45 would be 2. But I think you are correct. Thanks!
Yeah, important to use “round” and not “int”. :)
Im closing this because this should be covered by #62
It would be useful for me to be able to draw arrows on the screen. (Specifically, I would like to be able to show the wind direction graphically)
One way to do this would be to add some extra values to the "line" operator to put arrow heads at the beginning of the line, the end of the line, or both.