"""Constants for irrigation_unlimited."""

# Base component constants
NAME = "Irrigation Unlimited"
DOMAIN = "irrigation_unlimited"
DOMAIN_DATA = f"{DOMAIN}_data"
COORDINATOR = "coordinator"
COMPONENT = "component"
VERSION = "2024.5.0"
ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/"
ISSUE_URL = "https://github.com/rgc99/irrigation_unlimited/issues"

# Icons
ICON = "mdi:zodiac-aquarius"
ICON_ZONE_ON = "mdi:valve-open"
ICON_ZONE_OFF = "mdi:valve-closed"
ICON_DISABLED = "mdi:circle-off-outline"
ICON_SUSPENDED = "mdi:timer-outline"
ICON_BLOCKED = "mdi:alert-octagon-outline"
ICON_CONTROLLER_ON = "mdi:water"
ICON_CONTROLLER_OFF = "mdi:water-off"
ICON_CONTROLLER_PAUSED = "mdi:pause-circle-outline"
ICON_CONTROLLER_DELAY = "mdi:timer-sand"
ICON_SEQUENCE_ON = "mdi:play-circle-outline"
ICON_SEQUENCE_OFF = "mdi:stop-circle-outline"
ICON_SEQUENCE_PAUSED = "mdi:pause-circle-outline"
ICON_SEQUENCE_ZONE_ON = "mdi:play-circle-outline"
ICON_SEQUENCE_ZONE_OFF = "mdi:stop-circle-outline"
ICON_SEQUENCE_DELAY = "mdi:timer-sand"

# Platforms
BINARY_SENSOR = "binary_sensor"
PLATFORMS = [BINARY_SENSOR]

# Configuration and options
CONF_ENABLED = "enabled"
CONF_CONTROLLER = "controller"
CONF_CONTROLLERS = "controllers"
CONF_ZONE = "zone"
CONF_ZONES = "zones"
CONF_SCHEDULE = "schedule"
CONF_SCHEDULES = "schedules"
CONF_SUN = "sun"
CONF_TIME = "time"
CONF_DURATION = "duration"
CONF_PREAMBLE = "preamble"
CONF_POSTAMBLE = "postamble"
CONF_TESTING = "testing"
CONF_SPEED = "speed"
CONF_START = "start"
CONF_END = "end"
CONF_TIMES = "times"
CONF_GRANULARITY = "granularity"
CONF_PERCENTAGE = "percentage"
CONF_ACTUAL = "actual"
CONF_INCREASE = "increase"
CONF_DECREASE = "decrease"
CONF_RESET = "reset"
CONF_MINIMUM = "minimum"
CONF_MAXIMUM = "maximum"
CONF_MONTH = "month"
CONF_DAY = "day"
CONF_ODD = "odd"
CONF_EVEN = "even"
CONF_SHOW = "show"
CONF_CONFIG = "config"
CONF_TIMELINE = "timeline"
CONF_CONTROLLER_ID = "controller_id"
CONF_ZONE_ID = "zone_id"
CONF_SEQUENCE_ID = "sequence_id"
CONF_SEQUENCE = "sequence"
CONF_SEQUENCES = "sequences"
CONF_SEQUENCE_ZONE = "sequence_zone"
CONF_SEQUENCE_ZONES = "sequence_zones"
CONF_ALL_ZONES_CONFIG = "all_zones_config"
CONF_REFRESH_INTERVAL = "refresh_interval"
CONF_INDEX = "index"
CONF_RESULTS = "results"
CONF_OUTPUT_EVENTS = "output_events"
CONF_SHOW_LOG = "show_log"
CONF_AUTOPLAY = "autoplay"
CONF_FUTURE_SPAN = "future_span"
CONF_HISTORY = "history"
CONF_HISTORY_SPAN = "history_span"
CONF_SPAN = "span"
CONF_HISTORY_REFRESH = "history_refresh"
CONF_ANCHOR = "anchor"
CONF_FINISH = "finish"
CONF_LOGGING = "logging"
CONF_VERSION = "version"
CONF_RUN = "run"
CONF_SYNC_SWITCHES = "sync_switches"
CONF_RENAME_ENTITIES = "rename_entities"
CONF_ENTITY_BASE = "entity_base"
CONF_CLOCK = "clock"
CONF_MODE = "mode"
CONF_FIXED = "fixed"
CONF_SEER = "seer"
CONF_MAX_LOG_ENTRIES = "max_log_entries"
DEFAULT_MAX_LOG_ENTRIES = 50
CONF_ALLOW_MANUAL = "allow_manual"
CONF_CRON = "cron"
CONF_EVERY_N_DAYS = "every_n_days"
CONF_START_N_DAYS = "start_n_days"
CONF_CHECK_BACK = "check_back"
CONF_STATES = "states"
CONF_RETRIES = "retries"
CONF_RESYNC = "resync"
CONF_EXPECTED = "expected"
CONF_FOUND = "found"
CONF_STATE_ON = "state_on"
CONF_STATE_OFF = "state_off"
CONF_SCHEDULE_ID = "schedule_id"
CONF_FROM = "from"
CONF_VOLUME = "volume"
CONF_VOLUME_PRECISION = "volume_precision"
CONF_VOLUME_SCALE = "volume_scale"
CONF_FLOW_RATE_PRECISION = "flow_rate_precision"
CONF_FLOW_RATE_SCALE = "flow_rate_scale"
CONF_QUEUE = "queue"
CONF_QUEUE_MANUAL = "queue_manual"
CONF_USER = "user"
CONF_TOGGLE = "toggle"
CONF_EXTENDED_CONFIG = "extended_config"

# Defaults
DEFAULT_NAME = DOMAIN
DEFAULT_GRANULARITY = 60
DEFAULT_TEST_SPEED = 1.0
DEFAULT_REFRESH_INTERVAL = 30

# Services
SERVICE_ENABLE = "enable"
SERVICE_DISABLE = "disable"
SERVICE_TOGGLE = "toggle"
SERVICE_CANCEL = "cancel"
SERVICE_TIME_ADJUST = "adjust_time"
SERVICE_MANUAL_RUN = "manual_run"
SERVICE_LOAD_SCHEDULE = "load_schedule"
SERVICE_SUSPEND = "suspend"
SERVICE_SKIP = "skip"
SERVICE_PAUSE = "pause"
SERVICE_RESUME = "resume"

# Events
EVENT_START = "start"
EVENT_FINISH = "finish"
EVENT_INCOMPLETE = "incomplete"
EVENT_SYNC_ERROR = "sync_error"
EVENT_SWITCH_ERROR = "switch_error"

# Status
STATUS_DISABLED = "disabled"
STATUS_SUSPENDED = "suspended"
STATUS_BLOCKED = "blocked"
STATUS_INITIALISING = "initialising"
STATUS_PAUSED = "paused"
STATUS_DELAY = "delay"

# Timeline labels
TIMELINE_STATUS = "status"
TIMELINE_START = "start"
TIMELINE_END = "end"
TIMELINE_SCHEDULE_NAME = "schedule_name"
TIMELINE_ADJUSTMENT = "adjustment"

# Attributes
ATTR_ENABLED = "enabled"
ATTR_STATUS = "status"
ATTR_INDEX = "index"
ATTR_NAME = "name"
ATTR_CURRENT_SCHEDULE = "current_schedule"
ATTR_CURRENT_NAME = "current_name"
ATTR_CURRENT_ADJUSTMENT = "current_adjustment"
ATTR_CURRENT_START = "current_start"
ATTR_CURRENT_DURATION = "current_duration"
ATTR_BASE_DURATION = "base_duration"
ATTR_DEFAULT_DURATION = "default_duration"
ATTR_DEFAULT_DELAY = "default_delay"
ATTR_ADJUSTED_DURATION = "adjusted_duration"
ATTR_FINAL_DURATION = "final_duration"
ATTR_TOTAL_DELAY = "total_delay"
ATTR_TOTAL_DURATION = "total_duration"
ATTR_DURATION_FACTOR = "duration_factor"
ATTR_NEXT_SCHEDULE = "next_schedule"
ATTR_NEXT_ZONE = "next_zone"
ATTR_NEXT_NAME = "next_name"
ATTR_NEXT_ADJUSTMENT = "next_adjustment"
ATTR_NEXT_START = "next_start"
ATTR_NEXT_DURATION = "next_duration"
ATTR_TIME_REMAINING = "time_remaining"
ATTR_PERCENT_COMPLETE = "percent_complete"
ATTR_ZONE_COUNT = "zone_count"
ATTR_CURRENT_ZONE = "current_zone"
ATTR_TOTAL_TODAY = "today_total"
ATTR_SCHEDULE_COUNT = "schedule_count"
ATTR_ADJUSTMENT = "adjustment"
ATTR_CONFIGURATION = "configuration"
ATTR_TIMELINE = "timeline"
ATTR_SCHEDULE = "schedule"
ATTR_START = "start"
ATTR_DURATION = "duration"
ATTR_ZONES = "zones"
ATTR_SEQUENCE_STATUS = "sequence_status"
ATTR_ZONE_IDS = "zone_ids"
ATTR_CONTROLLER_COUNT = "controller_count"
ATTR_NEXT_TICK = "next_tick"
ATTR_TICK_LOG = "tick_log"
ATTR_SUSPENDED = "suspended"
ATTR_VOLUME = "volume"
ATTR_FLOW_RATE = "flow_rate"
ATTR_SWITCH_ENTITIES = "switch_entity_id"
ATTR_SEQUENCE_COUNT = "sequence_count"

# Resources
RES_MANUAL = "Manual"
RES_NOT_RUNNING = "not running"
RES_NONE = "none"
RES_CONTROLLER = "Controller"
RES_ZONE = "Zone"
RES_MASTER = "Master"
RES_TIMELINE_RUNNING = "running"
RES_TIMELINE_SCHEDULED = "scheduled"
RES_TIMELINE_NEXT = "next"
RES_TIMELINE_HISTORY = "history"

MONTHS = [
    "jan",
    "feb",
    "mar",
    "apr",
    "may",
    "jun",
    "jul",
    "aug",
    "sep",
    "oct",
    "nov",
    "dec",
]

STARTUP_MESSAGE = f"""
-------------------------------------------------------------------
{NAME}
Version: {VERSION}
If you have any issues with this you need to open an issue here:
{ISSUE_URL}
-------------------------------------------------------------------
"""
