from tidal_pi.light_strip.light_color import LightColor

OFF_COLOR = LightColor(0, 0, 0)
IN_TIDE_COLOR = LightColor(0, 0, 255)
OUT_TIDE_COLOR = LightColor(0, 255, 0)

LIGHT_0_IDX = 0 # low
LIGHT_1_IDX = 1 # 25
LIGHT_2_IDX = 2 # 50
LIGHT_3_IDX = 3 # 75
LIGHT_4_IDX = 4 # 90
LIGHT_5_IDX = 5 # high
LIGHT_6_IDX = 6 # 90
LIGHT_7_IDX = 7 # 75
LIGHT_8_IDX = 8 # 50
LIGHT_9_IDX = 9 # 25

# 90 4        5        6
# 75   3             7
# 50     2         8
# 25       1    9
# 10         0

LOW_TIDE_LEVEL_LIGHTS_ON = {
    0:  [LIGHT_0_IDX],
    13: [LIGHT_0_IDX],
    25: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_9_IDX],
    38: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_9_IDX],
    50: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    63: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    75: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_3_IDX, LIGHT_7_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    83: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_3_IDX, LIGHT_7_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    90: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_3_IDX, LIGHT_4_IDX, LIGHT_6_IDX, LIGHT_7_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    95: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_3_IDX, LIGHT_4_IDX, LIGHT_5_IDX, LIGHT_6_IDX, LIGHT_7_IDX, LIGHT_8_IDX, LIGHT_9_IDX]
}

LOW_TIDE_LEVEL_LIGHTS_FLASHING = {
    13: [LIGHT_1_IDX, LIGHT_9_IDX],
    38: [LIGHT_2_IDX, LIGHT_8_IDX],
    63: [LIGHT_3_IDX, LIGHT_7_IDX],
    83: [LIGHT_4_IDX, LIGHT_6_IDX],
    90: [LIGHT_5_IDX],
}

HIGH_TIDE_LEVEL_LIGHTS_ON = {
    0:  [LIGHT_0_IDX],
    13: [LIGHT_0_IDX],
    25: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_9_IDX],
    38: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_9_IDX],
    50: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    63: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    75: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_3_IDX, LIGHT_7_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    83: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_3_IDX, LIGHT_7_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    90: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_3_IDX, LIGHT_4_IDX, LIGHT_6_IDX, LIGHT_7_IDX, LIGHT_8_IDX, LIGHT_9_IDX],
    95: [LIGHT_0_IDX, LIGHT_1_IDX, LIGHT_2_IDX, LIGHT_3_IDX, LIGHT_4_IDX, LIGHT_5_IDX, LIGHT_6_IDX, LIGHT_7_IDX, LIGHT_8_IDX, LIGHT_9_IDX]
}

HIGH_TIDE_LEVEL_LIGHTS_FLASHING = {
    13: [LIGHT_1_IDX, LIGHT_9_IDX],
    38: [LIGHT_2_IDX, LIGHT_8_IDX],
    63: [LIGHT_3_IDX, LIGHT_7_IDX],
    83: [LIGHT_4_IDX, LIGHT_6_IDX],
    90: [LIGHT_5_IDX],
}