smudge / nightlight

A CLI for configuring "Night Shift" on macOS 🌕🌖🌗🌘🌑
MIT License
197 stars 8 forks source link

Give the lib a friendlier public API. #1

Closed smudge closed 4 years ago

smudge commented 4 years ago

Rather than this (named after the internal function, not the external use case):

pub fn enable(&self, enabled: bool) -> Result<(), String>

We now have:

pub fn on(&self) -> Result<(), String> 
pub fn off(&self) -> Result<(), String>
pub fn toggle(&self, on: bool) -> Result<(), String>

Also set_temp now accepts an integer instead of a string, since only the CLI should care about parsing the input strings.