Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
a4c1c51
added files
computergeek1507 Jun 30, 2025
9102338
rename
computergeek1507 Jun 30, 2025
8e047f3
fixes
computergeek1507 Jun 30, 2025
2306d12
got building
computergeek1507 Jul 1, 2025
0bea1d3
got building and running
computergeek1507 Jul 1, 2025
044f77c
icons not available
computergeek1507 Jul 1, 2025
cc27e92
Apply Some suggestions from code review, more to come
computergeek1507 Jul 5, 2025
275cd43
Update readme
computergeek1507 Jul 5, 2025
45eb7c1
fix headers
computergeek1507 Jul 5, 2025
5cd323d
fix channel names
computergeek1507 Jul 5, 2025
62c5c53
fix channel matching and readme
computergeek1507 Jul 5, 2025
bb722f4
Update bundles/org.openhab.binding.pirateweather/pom.xml
computergeek1507 Jul 21, 2025
fed3c12
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 13, 2025
9976390
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 13, 2025
9ee914d
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 13, 2025
3adde4b
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 13, 2025
efce55f
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 13, 2025
67e7820
Update bundles/org.openhab.binding.pirateweather/README.md
computergeek1507 Aug 13, 2025
f8e8bd2
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 13, 2025
8dc458e
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 13, 2025
6faf405
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 13, 2025
f01ed21
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 14, 2025
3dfc44f
replace Dark Sky text
computergeek1507 Aug 23, 2025
c62ca84
return on config fail
computergeek1507 Aug 23, 2025
ce6d41b
More review fixes
computergeek1507 Aug 23, 2025
f5f6fc9
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Aug 23, 2025
e798cf8
Spotless cleanup
computergeek1507 Aug 23, 2025
73fd8a1
Add Point and Property tags to addons (#18585)
andrewfg Jul 12, 2025
a3ea99b
Got building with AI help
computergeek1507 Aug 23, 2025
ee2945e
More fixes
computergeek1507 Aug 23, 2025
85a4cb0
languages fix and some other fixes
computergeek1507 Aug 23, 2025
1015e5b
Update bundles/org.openhab.binding.pirateweather/README.md
computergeek1507 Nov 29, 2025
9c75e40
Update bundles/org.openhab.binding.pirateweather/README.md
computergeek1507 Nov 29, 2025
8a22115
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Nov 29, 2025
b3a78f5
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 Dec 5, 2025
3adaac0
Add semantic equipment tag
computergeek1507 Dec 5, 2025
bc0d652
Update bundles/org.openhab.binding.pirateweather/pom.xml
computergeek1507 Dec 24, 2025
f6bf92f
Update PirateWeatherChannelConfiguration.java
computergeek1507 Mar 16, 2026
d5ec3a6
Add Semantic Tags for channels, update language init
computergeek1507 Mar 16, 2026
e33c1ad
Spotless
lsiepel May 4, 2026
c3c87a0
Fix build
lsiepel May 4, 2026
11c52ba
Update license headers
lsiepel May 4, 2026
8b146df
Swap xml lines to build
lsiepel May 4, 2026
069c1f1
add i18n stuff
computergeek1507 May 12, 2026
ce74207
extract rebuildChannels code, improve bridge status updates
computergeek1507 May 12, 2026
b19adc8
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 May 13, 2026
c299d27
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 May 13, 2026
6e8bdde
add null check
computergeek1507 May 15, 2026
ca09b68
fixes for Copilot review
computergeek1507 May 26, 2026
bded8ce
Update bundles/org.openhab.binding.pirateweather/src/main/resources/O…
computergeek1507 May 29, 2026
709c1f6
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 May 29, 2026
d2497ca
Update bundles/org.openhab.binding.pirateweather/src/main/java/org/op…
computergeek1507 May 29, 2026
4ea4518
Review fixes
computergeek1507 May 29, 2026
ed72fed
Fix build warnings
lsiepel Jun 11, 2026
23790a9
Fix review comments
lsiepel Jun 11, 2026
e10d5ba
Untangle connection/bridge/childhandlers
lsiepel Jun 12, 2026
e0a55de
Fix review comments
lsiepel Jun 16, 2026
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
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@
/bundles/org.openhab.binding.pihole/ @magx2
/bundles/org.openhab.binding.pilight/ @stefanroellin @niklasdoerfler
/bundles/org.openhab.binding.pioneeravr/ @Stratehm
/bundles/org.openhab.binding.pirateweather/ @computergeek1507
/bundles/org.openhab.binding.pixometer/ @Confectrician
/bundles/org.openhab.binding.pjlinkdevice/ @nils
/bundles/org.openhab.binding.playstation/ @FluBBaOfWard
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,11 @@
<artifactId>org.openhab.binding.pioneeravr</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.pirateweather</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.pixometer</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.pirateweather/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This content is produced and maintained by the openHAB project.

* Project home: https://www.openhab.org

== Declared Project Licenses

This program and the accompanying materials are made available under the terms
of the Eclipse Public License 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0/.

== Source Code

https://github.com/openhab/openhab-addons
339 changes: 339 additions & 0 deletions bundles/org.openhab.binding.pirateweather/README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions bundles/org.openhab.binding.pirateweather/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>5.2.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.pirateweather</artifactId>

<name>openHAB Add-ons :: Bundles :: Pirate Weather Binding</name>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.pirateweather-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-pirateweather" description="Pirate Weather Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.pirateweather/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* Copyright (c) 2010-2026 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.pirateweather.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.type.ChannelGroupTypeUID;

/**
* The {@link PirateWeatherBindingConstants} class defines common constants, which are used across the whole binding.
*
* @author Scott Hanson - Initial contribution
*/
@NonNullByDefault
public class PirateWeatherBindingConstants {

public static final String BINDING_ID = "pirateweather";

public static final String API = "api";
public static final String LOCAL = "local";

// Bridge
public static final ThingTypeUID THING_TYPE_WEATHER_API = new ThingTypeUID(BINDING_ID, "weather-api");

// Thing
public static final ThingTypeUID THING_TYPE_WEATHER_AND_FORECAST = new ThingTypeUID(BINDING_ID,
"weather-and-forecast");

// List of all properties
public static final String CONFIG_API_KEY = "apikey";
public static final String CONFIG_LANGUAGE = "language";
public static final String CONFIG_LOCATION = "location";
public static final String DEFAULT_LANGUAGE = "en";

// Channel group types
public static final ChannelGroupTypeUID CHANNEL_GROUP_TYPE_HOURLY_FORECAST = new ChannelGroupTypeUID(BINDING_ID,
"hourly-forecast");
public static final ChannelGroupTypeUID CHANNEL_GROUP_TYPE_DAILY_FORECAST = new ChannelGroupTypeUID(BINDING_ID,
"daily-forecast");
public static final ChannelGroupTypeUID CHANNEL_GROUP_TYPE_ALERTS = new ChannelGroupTypeUID(BINDING_ID, "alerts");

// List of all channel groups
public static final String CHANNEL_GROUP_CURRENT_WEATHER = "current";
public static final String CHANNEL_GROUP_FORECAST_TODAY = "forecast-today";
public static final String CHANNEL_GROUP_FORECAST_TOMORROW = "forecast-tomorrow";
public static final String CHANNEL_GROUP_ALERTS = "alerts";

// List of all channels
public static final String CHANNEL_TIME_STAMP = "time-stamp";
public static final String CHANNEL_CONDITION = "condition";
public static final String CHANNEL_CONDITION_ICON_ID = "icon-id";
public static final String CHANNEL_TEMPERATURE = "temperature";
public static final String CHANNEL_MIN_TEMPERATURE = "min-temperature";
public static final String CHANNEL_MAX_TEMPERATURE = "max-temperature";
public static final String CHANNEL_APPARENT_TEMPERATURE = "apparent-temperature";
public static final String CHANNEL_MIN_APPARENT_TEMPERATURE = "min-apparent-temperature";
public static final String CHANNEL_MAX_APPARENT_TEMPERATURE = "max-apparent-temperature";
public static final String CHANNEL_PRESSURE = "pressure";
public static final String CHANNEL_HUMIDITY = "humidity";
public static final String CHANNEL_WIND_SPEED = "wind-speed";
public static final String CHANNEL_WIND_DIRECTION = "wind-direction";
public static final String CHANNEL_GUST_SPEED = "gust-speed";
public static final String CHANNEL_CLOUDINESS = "cloudiness";
public static final String CHANNEL_VISIBILITY = "visibility";
public static final String CHANNEL_RAIN = "rain";
public static final String CHANNEL_SNOW = "snow";
public static final String CHANNEL_PRECIPITATION_INTENSITY = "precip-intensity";
public static final String CHANNEL_PRECIPITATION_PROBABILITY = "precip-probability";
public static final String CHANNEL_PRECIPITATION_TYPE = "precip-type";
public static final String CHANNEL_UVINDEX = "uvindex";
public static final String CHANNEL_OZONE = "ozone";
public static final String CHANNEL_SUNRISE = "sunrise";
public static final String CHANNEL_SUNSET = "sunset";
public static final String CHANNEL_ALERT_TITLE = "title";
public static final String CHANNEL_ALERT_ISSUED = "issued";
public static final String CHANNEL_ALERT_EXPIRES = "expires";
public static final String CHANNEL_ALERT_DESCRIPTION = "description";
public static final String CHANNEL_ALERT_SEVERITY = "severity";
public static final String CHANNEL_ALERT_URI = "uri";

public static final String TRIGGER_SUNRISE = CHANNEL_GROUP_CURRENT_WEATHER + "#sunrise-event";
public static final String TRIGGER_SUNSET = CHANNEL_GROUP_CURRENT_WEATHER + "#sunset-event";

public static final String EVENT_START = "START";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2010-2026 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.pirateweather.internal.config;

import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.pirateweather.internal.handler.PirateWeatherAPIHandler;

/**
* The {@link PirateWeatherAPIConfiguration} is the class used to match the {@link PirateWeatherAPIHandler}s
* configuration.
*
* @author Scott Hanson - Initial contribution
*/
@NonNullByDefault
public class PirateWeatherAPIConfiguration {

// supported languages (see https://pirateweather.net/dev/docs#forecast-request)
public static final Set<String> SUPPORTED_LANGUAGES = Collections
.unmodifiableSet(Stream
.of("ar", "az", "be", "bg", "bn", "bs", "ca", "cs", "cy", "da", "de", "el", "en", "eo", "es", "et",
"fa", "fi", "fr", "ga", "gd", "he", "hi", "hr", "hu", "id", "is", "it", "ja", "ka", "kn",
"ko", "kw", "lv", "ml", "mr", "nl", "no", "pa", "pl", "pt", "ro", "ru", "sk", "sl", "sr",
"sv", "ta", "te", "tet", "tr", "uk", "ur", "vi", "x-pig-latin", "zh", "zh-tw")
.collect(Collectors.toSet()));

public String apikey = "";
public int refreshInterval = 60;
public String language = "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* Copyright (c) 2010-2026 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.pirateweather.internal.config;

import java.time.Duration;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* The {@link PirateWeatherChannelConfiguration} is the class used to match the sunrise and sunset event configuration.
*
* @author Scott Hanson - Initial contribution
*/
@NonNullByDefault
public class PirateWeatherChannelConfiguration {

private final Logger logger = LoggerFactory.getLogger(PirateWeatherChannelConfiguration.class);

private int offset;
private @Nullable String earliest;
private @Nullable String latest;

public int getOffset() {
return offset;
}

public void setOffset(int offset) {
this.offset = offset;
}

public @Nullable String getEarliest() {
return earliest;
}

public long getEarliestInMinutes() {
return getMinutesFromTime(earliest);
}

public void setEarliest(String earliest) {
this.earliest = earliest;
}

public @Nullable String getLatest() {
return latest;
}

public long getLatestInMinutes() {
return getMinutesFromTime(latest);
}

public void setLatest(String latest) {
this.latest = latest;
}

@Override
public String toString() {
return String.format("[offset=%d, earliest='%s', latest='%s']", offset, earliest, latest);
}

/**
* Parses a hh:mm string and returns the minutes.
*/
public long getMinutesFromTime(@Nullable String configTime) {
if (configTime == null || configTime.isBlank()) {
return 0;
}

String time = configTime.trim();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
try {
LocalTime localTime = LocalTime.parse(time, formatter);
return Duration.ofHours(localTime.getHour()).plusMinutes(localTime.getMinute()).toMinutes();
} catch (DateTimeParseException ex) {
logger.warn("Cannot parse channel configuration '{}' to hour and minutes, use pattern HH:mm, ignoring!",
time);
return 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2010-2026 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.pirateweather.internal.config;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.pirateweather.internal.handler.PirateWeatherWeatherAndForecastHandler;

/**
* The {@link PirateWeatherWeatherAndForecastConfiguration} is the class used to match the
* {@link PirateWeatherWeatherAndForecastHandler}s configuration.
*
* @author Scott Hanson - Initial contribution
*/
@NonNullByDefault
public class PirateWeatherWeatherAndForecastConfiguration {
public int forecastHours;
public int forecastDays;
public int numberOfAlerts;
public String location = "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright (c) 2010-2026 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.pirateweather.internal.connection;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link PirateWeatherCommunicationException} is a communication exception for the connections to Pirate Weather
* API.
*
* @author Scott Hanson - Initial contribution
*/
@NonNullByDefault
public class PirateWeatherCommunicationException extends Exception {

private static final long serialVersionUID = 1L;

/**
* Constructs a new exception with null as its detail message.
*/
public PirateWeatherCommunicationException() {
super();
}

/**
* Constructs a new exception with the specified detail message.
*
* @param message Detail message
*/
public PirateWeatherCommunicationException(String message) {
super(message);
}

/**
* Constructs a new exception with the specified cause.
*
* @param cause The cause
*/
public PirateWeatherCommunicationException(Throwable cause) {
super(cause);
}

/**
* Constructs a new exception with the specified detail message and cause.
*
* @param message Detail message
* @param cause The cause
*/
public PirateWeatherCommunicationException(String message, Throwable cause) {
super(message, cause);
}
}
Loading
Loading