Code Monkey home page Code Monkey logo

swiftbar-plugins's People

Contributors

jhrcook avatar

Watchers

 avatar  avatar

swiftbar-plugins's Issues

Track shipment of new coffee

It would be nice to be able to track the shipment of new coffee. BRCC often uses USPS (API doc). This will require some level of write permission for the plug-in to store a tracking ID, so I'll have to wait until SwiftBar enables that.

API request notifications

Is there a way to submit a notification to my computer's Notification Center with the results of any PUT or PATCH requests? Currently, there is no feedback on how the requests do.

Logging errors instead of printing

This should be normal practice, but is especially helpful given the dependence of SwiftBar on standard out. Update everything to use logging to help with future debugging.

Coffee Tracker: add a new bag

Include a way to add a new bag. Due to the limitations of user input to a taskbar item, it might be best to have a button "New bag..." that then opens in the terminal with interactive prompts for brand, name, weight, etc.

Coffee Counter: Handle request errors

I should improve how network errors are handled. Here are a few ideas:

  1. If no network access is available, that should be indicated (perhaps with an empty "drop" as the logo) in the dropdown and no selections should be available.
  2. Alternatively, if there is not network access, I could use some simple caching to store the data that needs to be shown for the plugin and then cache input from the user (e.g. selecting a coffee bag). Then, the next time the plugin refreshes and there is internet access, check the cache for requests that need to be made.
  3. Multiple attempts for requests (gets and sets).

Use getter for number of coffee uses

Currently, the plugin pulls down all of the uses information for the day and then returns the length of the list. It would be faster and easier to just query the number of uses for the day directly.

def get_todays_uses() -> List[CoffeeUse]:
try:
response = requests.get(
api_url + f"uses/?n_last=20&since={get_today_formatted_datetime()}"
)
return [CoffeeUse(key=k, **i) for k, i in response.json().items()]
except Exception as err:
print(f"error: {err}")
return []
def get_number_of_cups_today() -> int:
cups: List[CoffeeUse] = get_todays_uses()
return len(cups)

Coffee Tracker: mark a bag as finished

There needs to be the ability to mark a bag as finished. Perhaps each bag could have a dropdown menu with options to add use or mark as finished? My only fear is how easy it would be to make a mistake with this UI. An alternative is to have a dropdown under "Finish bag" that shows each bag to be selected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.