Giter VIP home page Giter VIP logo

mmm-sort's Introduction

MMM-SORT

Static Or Rotating Tides

S.O.P.

As usual, this module was not made to compete with any others. I make simple modules because I enjoy doing it. I try to keep them small so that they don't use too much screen real estate. My hope is that they are all informative, or fun, or both.

What you get

Static**

  • A static display of the next 8 tides
  • High/Low tide icon indicator, day and time of tide
  • Your own text to indicate high or low tides (config option)
  • Day, date and time dim when the most recent tide passes
  • Name of the location of the tide station (If desired)
  • Tide station used is the closest to your longitude and latitude

Or

Rotating

  • A rotation of tides for the next 7 days
  • Day, date and time for each tide
  • High tide or Low tide with icon indicator
  • Height variance of tide in feet or meters (config option)
  • Name of the location of the tide station (If desired)
  • Tide station used is the closest to your longitude and latitude
  • The actual longitude and latitude of tide station being used (If desired)

Examples

Annotated .css file included for position, sizing, and coloring. Default is white.

  • Static. Color it any way you like. Don't want the location? It's gone!

, , ,

  • Rotating. One colored with header, one plain white with no header.

, ,

  • Display only the info that you want to see, line by line.

, ,

Installation

EDIT 4/11/20 Worldtides is no longer offering free api keys

  • No dependencies! No kidding!

Config.js entry and options

{
	disabled: false,
	module: "MMM-SORT",
	position: "top_left",
	config: {
		apiKey: "YOUR API KEY",     // free from https://www.worldtides.info/developer
		lat: "40.111111",           // your latitude
		lon: "-74.111111",          // your longitude
		mode: "static",             // static or rotating
                timeFormat: "  h:mm a",     // use standard time formatting (" HH:mm" for 24 hour)
		LowText: "Low",             // Low tide text. Whatever you want or nothing "",
		HighText: "High",           // High tide text. Whatever you want or nothing "",
		height: "ft",               // ft = feet, m = meters (When mode: is rotating)
		useHeader: false,           // false if you don't want a header      
		header: "",                 // Change in config file. useHeader must be true
		maxWidth: "300px",
		animationSpeed: 3000,       // fade speed
		rotateInterval: 20 * 1000,  // seconds (When mode: is rotating)
	}
},

Thanks to @yawns for the green light on developing this module

Special thanks to @Cowboysdude for correcting my mistakes. Freakin Guru!

mmm-sort's People

Contributors

mykle1 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

mmm-sort's Issues

MMM-sort wont load help needed

Hi every one..

i have got an issue with MMM-SORT - the module wont load,

is stuck on ( first the tide rushes in.. )

does anyone know why this is happened. i have valid key and also bough a credits so it should work correctly.

Stopped Loading Tide Data Oct. 1, 2021

Hello,
I started having an issue on Oct. 1, 2021. I have an API key and lots of credits, but when the MagicMirror starts up, the MMM-SORT module just hangs on the loading "First the tide rushes in...".

I verified my system can pull the API data from a browser window without issue. I've also noticed that the MMM-SORT module is NOT using any API credits on boot anymore. I'm guessing because it's not loading enough to actually pull the data?

I tested also re-pulling things fresh down from github but it didn't help.

No other modules seem to be having issues. Anyone else having this problem?

Cannot find module 'request'

Hello!

I'm getting an error on start up:

[14.01.2024 08:16.51.308] [ERROR] (node:62898) UnhandledPromiseRejectionWarning: Error: Cannot find module 'request'
Require stack:
- /Users/davemartinez/projects/MagicMirror/modules/MMM-SORT/node_helper.js
- /Users/davemartinez/projects/MagicMirror/js/app.js
- /Users/davemartinez/projects/MagicMirror/js/electron.js
- /Users/davemartinez/projects/MagicMirror/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js
- 
    at node:internal/modules/cjs/loader:1084:15
    at Function.<anonymous> (node:electron/js2c/browser_init:2:116646)
    at Module._resolveFilename (/Users/davemartinez/projects/MagicMirror/node_modules/module-alias/index.js:49:29)
    at node:internal/modules/cjs/loader:929:27
    at Function._load (node:electron/js2c/asar_bundle:2:13327)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at Object.<anonymous> (/Users/davemartinez/projects/MagicMirror/modules/MMM-SORT/node_helper.js:8:17)
    at Module._compile (node:internal/modules/cjs/loader:1271:14)
    at Object..js (node:internal/modules/cjs/loader:1326:10)
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/asar_bundle:2:13327)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at loadModule (/Users/davemartinez/projects/MagicMirror/js/app.js:181:19)

const request = require('request');

The root cause is pretty obvious: there's no dependency on the request library. The library's npm page says its deprecated. Despite the deprecation, it's still getting 14MM downloads each month, so it's pretty well used.

There's a few options here:

  1. Add a package.json and declare a dependency on request
  2. Refactor a little bit to use http
  3. Add to the instructions to npm i --save request after install

Option 3 is the easiest workaround I'm using for now!

I'm happy to submit a PR for any of these!

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.