Skip to content

Commit

Permalink
⬆️ v2.1.0 - multi provider + city name (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaouherK authored May 19, 2021
1 parent 9b74b44 commit e942db3
Show file tree
Hide file tree
Showing 10 changed files with 1,045 additions and 886 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# IntelliJ project files
.idea

# vscode project files
.vscode
29 changes: 26 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,67 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.0] - 2020-05-19

### Added

- New provider Open Map API for weather data
- Add weather Icon + city name in same canvas and render from it
- Display city name
- Generic link to "Get API Key" dependant on the selected provider
- Added badge of version

### Changed

- Align software and hardware display
- Fix small bugs

## [2.0.2] - 2020-04-25

### Changed

- New function to set default value for dropdown
- Cleaned javascript code

## [2.0.1] - 2020-04-20

### Added

- Catch failure in response from weatherAPI to display error alert
- Show the city name in the software title
- Initial gitignore and Changelog files

### Changed

- Updated manifest file (tooltip, author full name, author website, description, version bump)
- Force the city name to be transformed to lowercase
- Added a link in plugin to submit a bug report
- Screenshot for readme updated

### Removed

- hidden .idea folder has been deleted

## [2.0.0] - 2020-04-18

### Added

- Possible selection of temperature units (celsius or fahrenheit)
- Set frequency of fetching of data (on push, 10 minutes, 30 minutes, 1 hour)

### Changed
- Select provider drop down list
- Rework the whole script for fetching data while implementing setInterval to get relevant data

### Removed
- Select provider drop down list
- Rework the whole script for fetching data while implementing setInterval to get relevant data

## [1.0.0] - 2020-04-16

### Added

- Initial structure of plugin
- link to weatherAPI to fetch data
- Inputs provided are API key and City
Expand All @@ -48,3 +70,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[2.0.0]: https://github.com/JaouherK/streamDeck-weatherPlugin/releases/tag/v1.0
[2.0.1]: https://github.com/JaouherK/streamDeck-weatherPlugin/releases/tag/v2.0.1
[2.0.2]: https://github.com/JaouherK/streamDeck-weatherPlugin/releases/tag/v2.0.2
[2.0.2]: https://github.com/JaouherK/streamDeck-weatherPlugin/releases/tag/v2.1.0
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@

# Description
# Weather

`Weather` is a plugin that displays the weather condition and the temperature of a given city. It is connected to WeatherApi provider and needs an API Key to connect.
[![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/JaouherK/a489177df4f24946281bdc1b21524b13/raw/2a1aa8de67ca47bf45667a18bd2cdd8bc6ea0e30/weatherMetaData.json)](https://github.com/JaouherK/streamDeck-weatherPlugin/releases/tag/v2.1.0)

`Weather` is a plugin that displays the weather condition as a picture image, the city name and the temperature of a given location. It is connected to multiple providers and needs an API Key to connect.

Possible providers:

- WeatherAPI
- OpenWeather

Optionally, you can choose the frequency of fetching updated data and the temperature unit ( Celsius or Fahrenheit).

# Button settings

The button is configured as follows:

- Title: Please do not set any value in order to display the temperature correctly
- Image: Please do not update picture in order to display the weather icon correctly
- Provider: the weather information provider: WeatherAPI or OpenWeather
- API key: your provider account key available in your account information on the associated provider website
- City Name: the city for which the information will be displayed on the button
- Temperature: the temperature unit ( Celsius or Fahrenheit)
- Fetch frequency: how often the data is updated (beware for free accounts the limits set by the provider)
- "Get my API key" button: to retrieve the key for your account
- "Report bug" button: to report a bug

# Features

- code written in Javascript
Expand All @@ -13,16 +34,14 @@ Optionally, you can choose the frequency of fetching updated data and the temper
- Choose temperature unit
- choose fetching frequency of the weather data

![](screenshot.png)

![screen](screenshot.png)

# Installation

In the Release folder, you can find the file `com.jk.weather.streamDeckPlugin`. If you double-click this file on your machine, Stream Deck will install the plugin.


# Source code

The `Sources` folder contains the source code of the plugin.

<div>Application main icon made by <a href="https://www.flaticon.com/authors/smashicons" title="Smashicons">Smashicons</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
Application main icon made by [Smashicons](https://www.flaticon.com/authors/smashicons) from [www.flaticon.com](https://www.flaticon.com/)
Binary file modified Release/com.jk.weather.streamDeckPlugin
Binary file not shown.
77 changes: 38 additions & 39 deletions Sources/com.jk.weather.sdPlugin/manifest.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
{
"Actions": [
{
"Icon": "resources/actionIcon",
"Name": "Weather",
"States": [
{
"Image": "resources/actionDefaultImage",
"TitleAlignment": "bottom",
"FontSize": "10"
}
],
"SupportedInMultiActions": true,
"Tooltip": "Get current weather condition and temperature of a given city",
"UUID": "com.jk.weather.action"
}
],
"SDKVersion": 2,
"Author": "Jaouher Kharrat",
"CodePath": "plugin/main.html",
"Description": "Easily get a preview of the weather condition and the temperature of a given city.",
"Name": "Weather",
"Icon": "resources/pluginIcon",
"PropertyInspectorPath": "pi/main_pi.html",
"URL": "https://github.com/JaouherK",
"Version": "2.0.2",
"OS": [
{
"Platform": "mac",
"MinimumVersion" : "10.11"
},
{
"Platform": "windows",
"MinimumVersion" : "10"
}
],
"Software":
{
"MinimumVersion" : "4.1"
}
"Actions": [
{
"Icon": "resources/actionIcon",
"Name": "Weather",
"States": [
{
"Image": "resources/actionDefaultImage",
"TitleAlignment": "bottom",
"FontSize": "10"
}
],
"SupportedInMultiActions": true,
"Tooltip": "Get current weather condition and temperature of a given city",
"UUID": "com.jk.weather.action"
}
],
"SDKVersion": 2,
"Author": "Jaouher Kharrat",
"CodePath": "plugin/main.html",
"Description": "Easily get a preview of the weather condition and the temperature of a given city.",
"Name": "Weather",
"Icon": "resources/pluginIcon",
"PropertyInspectorPath": "pi/main_pi.html",
"URL": "https://github.com/JaouherK",
"Version": "2.1.0",
"OS": [
{
"Platform": "mac",
"MinimumVersion": "10.11"
},
{
"Platform": "windows",
"MinimumVersion": "10"
}
],
"Software": {
"MinimumVersion": "4.1"
}
}
114 changes: 73 additions & 41 deletions Sources/com.jk.weather.sdPlugin/pi/main_pi.html
Original file line number Diff line number Diff line change
@@ -1,64 +1,96 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8"/>
<head>
<meta charset="utf-8" />
<title>com.jk.weather.pi</title>
<link rel="stylesheet" href="sdpi.css">
<link rel="stylesheet" href="sdpi.css" />
<script src="main_pi.js"></script>
</head>
</head>

<body>
<div class="sdpi-wrapper hidden">
<div class="sdpi-item" id="apiProviderContainer">
<body>
<div class="sdpi-wrapper hidden">
<div class="sdpi-item" id="apiProviderContainer">
<div class="sdpi-item-label">Provider</div>
<select class="sdpi-item-value select" id="api">
<option value="weatherApi">WeatherAPI</option>
<select
class="sdpi-item-value select"
id="provider"
onchange="updateGlobal()"
>
<option value="weatherApi">Weather API</option>
<option value="openWeatherMap">Open Weather</option>
</select>
</div>
<div class="sdpi-item">
</div>
<div class="sdpi-item">
<details class="message info">
<summary>Please do not set a title or an image for this plugin as they are being generated on the fly!</summary>
<summary>
Please do not set a title or an image for this plugin as they are
being generated on the fly!
</summary>
</details>
</div>
</div>

<div class="sdpi-heading">API SETUP</div>
<div class="sdpi-heading">API SETUP</div>

<div class="sdpi-item">
<div class="sdpi-item">
<div class="sdpi-item-label">API Key</div>
<input class="sdpi-item-value" id="apiKey" value="" onchange="updateApiKey()"
placeholder="Enter your WeatherApi Key" required>
</div>
<div class="sdpi-item">
<input
class="sdpi-item-value"
id="apiKey"
value=""
onchange="updateGlobal()"
placeholder="Enter your WeatherApi Key"
required
/>
</div>
<div class="sdpi-item">
<div class="sdpi-item-label">City Name</div>
<input class="sdpi-item-value" id="cityName" value="" onchange="updateSettings()"
placeholder="Enter the city for the current weather details" required>
</div>
<input
class="sdpi-item-value"
id="cityName"
value=""
onchange="updateSettings()"
placeholder="Enter the city for the current weather details"
required
/>
</div>

<div class="sdpi-item">
<div class="sdpi-item">
<div class="sdpi-item-label">Temperature</div>
<select class="sdpi-item-value select" id="unit" onchange="updateSettings()">
<option value="celsius">Celsius °C</option>
<option value="fahrenheit">Fahrenheit °F</option>
<select
class="sdpi-item-value select"
id="unit"
onchange="updateSettings()"
>
<option value="celsius">Celsius °C</option>
<option value="fahrenheit">Fahrenheit °F</option>
</select>
</div>
</div>

<div class="sdpi-item">
<div class="sdpi-item">
<div class="sdpi-item-label">Fetch frequency</div>
<select class="sdpi-item-value select" id="frequency" onchange="updateSettings()">
<option value="0">On push</option>
<option value="600000">10 Minutes</option>
<option value="1800000">30 Minutes</option>
<option value="3600000">1 Hour</option>
<select
class="sdpi-item-value select"
id="frequency"
onchange="updateSettings()"
>
<option value="0">On push</option>
<option value="600000">10 Minutes</option>
<option value="1800000">30 Minutes</option>
<option value="3600000">1 Hour</option>
</select>
</div>
</div>

<div class="sdpi-item">
<button class="sdpi-item-value" onclick="openPage('weatherapi.com/my/')">Get my API key</button>
<button class="sdpi-item-value" onclick="openPage('github.com/JaouherK/streamDeck-weatherPlugin/issues/new?assignees=JaouherK&labels=bug&template=bug_report.md&title=Bug+report')">Report bug
<div class="sdpi-item">
<button class="sdpi-item-value" onclick="openPage(getProviderUrl())">
Get my API key
</button>
<button
class="sdpi-item-value"
onclick="openPage('github.com/JaouherK/streamDeck-weatherPlugin/issues/new?assignees=JaouherK&labels=bug&template=bug_report.md&title=Bug+report')"
>
Report bug
</button>
</div>
</div>
</div>
</body>

</body>
</html>
Loading

0 comments on commit e942db3

Please sign in to comment.