Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Freeboxos] New binding alternative to Freebox binding #12342

Merged
merged 91 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
fc0aad1
SAT warnings handling
clinique Feb 23, 2022
1533cbf
Correcting potential NPE
clinique Mar 12, 2022
56f45e2
Correcting a NPE on error
clinique Mar 15, 2022
8884e2e
Active player request falls to incorrect API version
clinique Mar 18, 2022
990cf26
Reintroducing missing capability to send keys to player.
clinique Apr 5, 2022
db1dd67
Handling DUTY CYCLE more gracefully
clinique Jul 1, 2022
b964e45
Enhancing DUTY CYCLE
clinique Jul 4, 2022
ad5ec97
Moving to SNAPSHOT 3.4
clinique Jul 23, 2022
40ce57f
Adress inconsistencies in binding name
clinique Jul 24, 2022
5ddb78a
Discover Freebox Delta Home equipments(basic_shutter)
ben12 Aug 21, 2022
f8e5aff
Clean previous test code
ben12 Aug 23, 2022
c1e9fb3
Fix "Unexpected command"
ben12 Aug 23, 2022
e23ae88
Fix thing comm error
ben12 Aug 26, 2022
08196f0
README for basic shutter
ben12 Aug 29, 2022
e6d77f1
Fix MR discusions and solve maven check errors and warnings
ben12 Sep 1, 2022
8dc8d93
Fix MR discusions
ben12 Sep 1, 2022
81469e5
Fix README.md
ben12 Sep 1, 2022
d58bb3e
Enhancing logging to indentify source of erratic warn
clinique Nov 11, 2022
cb32b42
Deny polling a device data when its API is needed and it is OFFLINE
clinique Dec 22, 2022
9b3dd72
Taking #11833 in accound
clinique Dec 24, 2022
815643d
Switching to Snapshot 4.0.0
clinique Dec 29, 2022
7e1a2df
Implementing SHUTTER Home Node
clinique Dec 29, 2022
f437308
Saving work before instroduction of ArrayListDeserializer
clinique Jan 13, 2023
376de7b
Enhanced deserialization to simplify code
clinique Jan 16, 2023
1338f19
Switching to Java 17 records
clinique Jan 20, 2023
b0fcb9a
Switching to addons.xml, headers updated
clinique Jan 20, 2023
54c0821
Correcting two errors.
clinique Jan 20, 2023
5402d26
Enhance usage of global variables
clinique Jan 21, 2023
fdf9368
Some code enhancement for base classes
clinique Jan 21, 2023
48d259e
solving SAT issues
clinique Jan 21, 2023
c18dd67
Adding IliadBox compatibility
clinique Feb 10, 2023
0f86e03
Commiting work
clinique Feb 12, 2023
6c9028c
Saving work
clinique Feb 14, 2023
3880b77
Rebooting Home Node part
clinique Feb 16, 2023
c2877a8
Spotless apply
clinique Feb 16, 2023
4f7aa82
Adding i18n
clinique Mar 9, 2023
a320471
Decreasing websocket logging level
clinique Apr 24, 2023
83060e5
SAT warnings handling
clinique Feb 23, 2022
4802a15
Correcting potential NPE
clinique Mar 12, 2022
1003584
Correcting a NPE on error
clinique Mar 15, 2022
38178f3
Active player request falls to incorrect API version
clinique Mar 18, 2022
74c99cc
Reintroducing missing capability to send keys to player.
clinique Apr 5, 2022
6d868b5
Handling DUTY CYCLE more gracefully
clinique Jul 1, 2022
d54a254
Enhancing DUTY CYCLE
clinique Jul 4, 2022
f5a049e
Moving to SNAPSHOT 3.4
clinique Jul 23, 2022
7280ac4
Adress inconsistencies in binding name
clinique Jul 24, 2022
7b0b790
Discover Freebox Delta Home equipments(basic_shutter)
ben12 Aug 21, 2022
a328839
Clean previous test code
ben12 Aug 23, 2022
52b9ac2
Fix "Unexpected command"
ben12 Aug 23, 2022
a6e57bc
Fix thing comm error
ben12 Aug 26, 2022
814deab
README for basic shutter
ben12 Aug 29, 2022
8728703
Fix MR discusions and solve maven check errors and warnings
ben12 Sep 1, 2022
0bdfc0d
Fix MR discusions
ben12 Sep 1, 2022
6809d6d
Fix README.md
ben12 Sep 1, 2022
23ead80
Enhancing logging to indentify source of erratic warn
clinique Nov 11, 2022
f12259c
Deny polling a device data when its API is needed and it is OFFLINE
clinique Dec 22, 2022
564e07a
Taking #11833 in accound
clinique Dec 24, 2022
df778a2
Switching to Snapshot 4.0.0
clinique Dec 29, 2022
4e1b84d
Implementing SHUTTER Home Node
clinique Dec 29, 2022
bab969a
Saving work before instroduction of ArrayListDeserializer
clinique Jan 13, 2023
29f1499
Enhanced deserialization to simplify code
clinique Jan 16, 2023
0e70eed
Switching to Java 17 records
clinique Jan 20, 2023
b4177dd
Switching to addons.xml, headers updated
clinique Jan 20, 2023
29270ae
Correcting two errors.
clinique Jan 20, 2023
c6edc35
Enhance usage of global variables
clinique Jan 21, 2023
c669dd8
Some code enhancement for base classes
clinique Jan 21, 2023
d8f7331
solving SAT issues
clinique Jan 21, 2023
dcb36b0
Adding IliadBox compatibility
clinique Feb 10, 2023
cb2d7e7
Commiting work
clinique Feb 12, 2023
bfa9e1f
Saving work
clinique Feb 14, 2023
0e6b3f2
Rebooting Home Node part
clinique Feb 16, 2023
9618d06
Spotless apply
clinique Feb 16, 2023
8ba0271
Enhancing SAT report
clinique Apr 24, 2023
efd7c3e
I think that mvn spotless:apply has a problem with records - trying o…
clinique Apr 24, 2023
2fcba0a
Avoid requesting detailed information for a shutdown repeater.
clinique Apr 28, 2023
f638cb0
Switched fan speed to RPM unit
clinique May 23, 2023
fc920d5
Correcting SAT
clinique May 23, 2023
905a671
Correcting SAT
clinique May 23, 2023
e3137db
Divergence between eclipse and mvn spotless:apply
clinique May 23, 2023
50991bc
YASAT
clinique May 23, 2023
c3e9434
Corrections following fwolter code review
clinique Jun 21, 2023
bd41053
Pleasing SAT
clinique Jun 21, 2023
14adc08
Second fwolter code review
clinique Jun 22, 2023
df30151
Porting modifications introduced in PR #15121
clinique Jun 22, 2023
d9712cc
Removing redundant null checks.
clinique Jun 26, 2023
e07249f
Rebased.
clinique Jun 26, 2023
f05d318
Trying to remove the last sleep.
clinique Jun 30, 2023
76f82f1
Reporting modifications of PR #15121
clinique Jul 2, 2023
dabbc2f
Reverting to working and cleaner granting process
clinique Jul 2, 2023
4a6e835
Removing last Thread:Sleep
clinique Jul 4, 2023
adeb086
spotless:apply
clinique Jul 4, 2023
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 @@ -110,6 +110,7 @@
/bundles/org.openhab.binding.folding/ @fa2k
/bundles/org.openhab.binding.foobot/ @airboxlab @Hilbrand
/bundles/org.openhab.binding.freebox/ @lolodomo
/bundles/org.openhab.binding.freeboxos/ @clinique
/bundles/org.openhab.binding.fronius/ @trokohl
/bundles/org.openhab.binding.fsinternetradio/ @paphko
/bundles/org.openhab.binding.ftpupload/ @paulianttila
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 @@ -546,6 +546,11 @@
<artifactId>org.openhab.binding.freebox</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.freeboxos</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.fronius</artifactId>
Expand Down
20 changes: 20 additions & 0 deletions bundles/org.openhab.binding.freeboxos/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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

== Third-party Content

IPAddress: Java library for handling IP addresses and subnets, both IPv4 and IPv6
* License: Apache License 2.0
* Project: https://github.com/seancfoley/IPAddress
* Source: https://github.com/seancfoley/IPAddress
210 changes: 210 additions & 0 deletions bundles/org.openhab.binding.freeboxos/README.md

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions bundles/org.openhab.binding.freeboxos/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>4.0.0-SNAPSHOT</version>
</parent>

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

<name>openHAB Add-ons :: Bundles :: FreeboxOS Binding</name>

<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be part of the OH core. Are you sure you need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be but I used version 2.10 of gson that accepts deserialization of records. There's an open issue on this in core

<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.github.seancfoley</groupId>
<artifactId>ipaddress</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license of this dependency needs to be added to NOTICE.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

<version>5.4.0</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.freeboxos-${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-freeboxos" description="Freebox OS Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<feature>openhab-transport-mdns</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.freeboxos/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
/**
* Copyright (c) 2010-2023 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.freeboxos.internal;

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

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.freeboxos.internal.api.rest.HomeManager.Category;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.library.types.OpenClosedType;
import org.openhab.core.library.types.UpDownType;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.types.Command;

/**
* The {@link FreeboxBinding} class defines common constants, which are used across the binding.
*
* @author Gaël L'hopital - Initial contribution
*/
@NonNullByDefault
public class FreeboxOsBindingConstants {

public static final String BINDING_ID = "freeboxos";

// List of all Bridge Type UIDs
public static final ThingTypeUID BRIDGE_TYPE_API = new ThingTypeUID(BINDING_ID, "api");

// Thing Types ID strings
private static final String THING_DECT = "dect";
private static final String THING_FXS = "fxs";
private static final String THING_REVOLUTION = "revolution";
private static final String THING_DELTA = "delta";
private static final String THING_WIFI_HOST = "wifihost";
private static final String THING_ACTIVE_PLAYER = "active-player";

public static final String THING_FREEPLUG = "freeplug";
public static final String THING_VM = "vm";
public static final String THING_CALL = "call";
public static final String THING_HOST = "host";
public static final String THING_PLAYER = "player";
public static final String THING_REPEATER = "repeater";

// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_REVOLUTION = new ThingTypeUID(BINDING_ID, THING_REVOLUTION);
public static final ThingTypeUID THING_TYPE_DELTA = new ThingTypeUID(BINDING_ID, THING_DELTA);
public static final ThingTypeUID THING_TYPE_FXS = new ThingTypeUID(BINDING_ID, THING_FXS);
public static final ThingTypeUID THING_TYPE_DECT = new ThingTypeUID(BINDING_ID, THING_DECT);
public static final ThingTypeUID THING_TYPE_CALL = new ThingTypeUID(BINDING_ID, THING_CALL);
public static final ThingTypeUID THING_TYPE_FREEPLUG = new ThingTypeUID(BINDING_ID, THING_FREEPLUG);
public static final ThingTypeUID THING_TYPE_HOST = new ThingTypeUID(BINDING_ID, THING_HOST);
public static final ThingTypeUID THING_TYPE_WIFI_HOST = new ThingTypeUID(BINDING_ID, THING_WIFI_HOST);
public static final ThingTypeUID THING_TYPE_PLAYER = new ThingTypeUID(BINDING_ID, THING_PLAYER);
public static final ThingTypeUID THING_TYPE_ACTIVE_PLAYER = new ThingTypeUID(BINDING_ID, THING_ACTIVE_PLAYER);
public static final ThingTypeUID THING_TYPE_VM = new ThingTypeUID(BINDING_ID, THING_VM);
public static final ThingTypeUID THING_TYPE_REPEATER = new ThingTypeUID(BINDING_ID, THING_REPEATER);

// All supported Thing types
public static final Set<ThingTypeUID> BRIDGE_TYPE_UIDS = Set.of(BRIDGE_TYPE_API);
public static final Set<ThingTypeUID> THINGS_TYPES_UIDS = Set.of(THING_TYPE_FXS, THING_TYPE_DECT, THING_TYPE_CALL,
THING_TYPE_HOST, THING_TYPE_VM, THING_TYPE_PLAYER, THING_TYPE_ACTIVE_PLAYER, THING_TYPE_DELTA,
THING_TYPE_REVOLUTION, THING_TYPE_REPEATER, THING_TYPE_WIFI_HOST, THING_TYPE_FREEPLUG);
public static final Set<ThingTypeUID> HOME_TYPES_UIDS = Set.of(Category.BASIC_SHUTTER.getThingTypeUID(),
Category.SHUTTER.getThingTypeUID(), Category.KFB.getThingTypeUID(), Category.CAMERA.getThingTypeUID(),
Category.ALARM.getThingTypeUID());

protected static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream
.of(BRIDGE_TYPE_UIDS, THINGS_TYPES_UIDS, HOME_TYPES_UIDS).flatMap(Set::stream).collect(Collectors.toSet());

// Thing properties
// public static final String LAST_CALL_TIMESTAMP = "lastCallTimestamp";
public static final String ROLE = "role";
public static final String NET_ID = "netId";
public static final String ETHERNET_SPEED = "ethernetSpeed";
public static final String LOCAL = "local";
public static final String FULL_DUPLEX = "fullDuplex";

// List of all Group Channel ids
public static final String GROUP_SENSORS = "sensors";
public static final String GROUP_FANS = "fans";
public static final String CONNECTION_STATUS = "connection-status";
public static final String SYS_INFO = "sysinfo";
public static final String ACTIONS = "actions";
public static final String FILE_SHARING = "file-sharing";
public static final String CONNECTIVITY = "connectivity";
public static final String DISPLAY = "display";
public static final String VM_STATUS = "vmstatus";
public static final String GROUP_WIFI = "wifi";
public static final String REPEATER_MISC = "repeater-misc";

// List of all Channel ids
public static final String RSSI = "rssi";
public static final String SSID = "ssid";
public static final String WIFI_QUALITY = "wifi-quality";
public static final String WIFI_HOST = "wifi-host";
public static final String UPTIME = "uptime";
public static final String BOX_EVENT = "box-event";
public static final String LCD_BRIGHTNESS = "lcd-brightness";
public static final String LCD_ORIENTATION = "lcd-orientation";
public static final String LCD_FORCED = "lcd-forced";
public static final String WIFI_STATUS = "wifi-status";
public static final String IP_ADDRESS = "ip-address";
public static final String IPV6_ADDRESS = "ipv6-address";
public static final String LINE_STATUS = "line-status";
public static final String LINE_TYPE = "line-type";
public static final String LINE_MEDIA = "line-media";
public static final String PLAYER_STATUS = "player-status";
public static final String PACKAGE = "package";
public static final String RATE = "rate";
public static final String BYTES_UP = "bytes-up";
public static final String BYTES_DOWN = "bytes-down";
public static final String BW = "bandwidth";
public static final String PCT_BW = "bandwidth-usage";
public static final String ONHOOK = "onhook";
public static final String RINGING = "ringing";
public static final String HARDWARE_STATUS = "hardware-status";
public static final String TELEPHONY_SERVICE = "telephony-service";
public static final String GAIN_RX = "gain-rx";
public static final String GAIN_TX = "gain-tx";
public static final String FTP_STATUS = "ftp-status";
public static final String SAMBA_FILE_STATUS = "samba-file-status";
public static final String SAMBA_PRINTER_STATUS = "samba-printer-status";
public static final String AFP_FILE_STATUS = "afp-file-status";
public static final String REACHABLE = "reachable";
public static final String LAST_SEEN = "last-seen";
public static final String ALTERNATE_RING = "lcd-forced";
public static final String DECT_ACTIVE = "dect-active";
public static final String UPNPAV_STATUS = "upnpav-status";

// Call channels for groups Accepted, Missed and Outgoing
public static final String NUMBER = "number";
public static final String DURATION = "duration";
public static final String TIMESTAMP = "timestamp";
public static final String NAME = "name";

// Freebox player channels
public static final String AIRMEDIA_STATUS = "airmedia-status";
public static final String KEY_CODE = "key-code";

// Virtual machine channels
public static final String STATUS = "status";

// Repeater channels
public static final String LED = "led";
public static final String HOST_COUNT = "host-count";

// Home channels
public static final String KEYFOB_ENABLE = "enable";
public static final String NODE_BATTERY = "battery";
public static final String SHUTTER_POSITION = "position-set";
public static final String SHUTTER_STOP = "stop";
public static final String BASIC_SHUTTER_STATE = "state";
public static final String BASIC_SHUTTER_UP = "up";
public static final String BASIC_SHUTTER_DOWN = "down";
// public static final String BASIC_SHUTTER_CMD = "basic-shutter";
public static final String ALARM_PIN = "pin";
public static final String ALARM_SOUND = "sound";
public static final String ALARM_VOLUME = "volume";
public static final String ALARM_TIMEOUT1 = "timeout1";
public static final String ALARM_TIMEOUT2 = "timeout2";
public static final String ALARM_TIMEOUT3 = "timeout3";

public static final Set<Command> TRUE_COMMANDS = Set.of(OnOffType.ON, UpDownType.UP, OpenClosedType.OPEN);
public static final Set<Class<?>> ON_OFF_CLASSES = Set.of(OnOffType.class, UpDownType.class, OpenClosedType.class);
}
Loading