Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/epomakercontroller/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Simple CLI for the EpomakerController package."""

import tkinter as tk
from dateutil import parser
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not needed since you use dateutil.parser.parse(time)

from functools import wraps
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import should be

from functools import wraps
import dateutil


import click
Expand Down Expand Up @@ -91,10 +92,19 @@ def cycle_light_modes(controller: EpomakerController) -> None:


@cli.command()
@click.argument("time", type=str, required=False)
@wrapped_command
def send_time(controller: EpomakerController) -> None:
"""Send the current time to the Epomaker device."""
controller.send_time()
def send_time(controller: EpomakerController, time: str) -> None:
"""Send the current time to the Epomaker device.

Args:
controller (EpomakerController): Passed from wrapped_command() decorator
time (str): time to send (parsed by dateutil parser)
"""
if time is not None:
time=parser.parse(time)

controller.send_time(time)
Logger.log_info("Time sent successfully.")


Expand Down
Loading