paul-butcher / light_character

Animate navigational light characteristics
MIT License
0 stars 0 forks source link

Mis-parse on a flasher with an lengthy idle period #1

Open dirkx opened 11 months ago

dirkx commented 11 months ago

Description

Parsing of "Q(9) W 10s" (Buoy in the Irish sea, just of the point of Ayre) yields:

               [('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('W', 3250), ('Off', 250)] *

Which I suspect needs to be

               [('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 3500)] 

I.e. 9 flashes and a pause to make the total length 10 seconds.

What I Did

        print(light_character.light_character.characteristic_to_light_states("Q(9) W 10s"))
dirkx commented 11 months ago

B.t.w - collapsing states makes it 'worse':

                         [('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 500), ('Off', 250), ('W', 3750), ('Off', 250)] */