-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
fc0aad1
SAT warnings handling
clinique 1533cbf
Correcting potential NPE
clinique 56f45e2
Correcting a NPE on error
clinique 8884e2e
Active player request falls to incorrect API version
clinique 990cf26
Reintroducing missing capability to send keys to player.
clinique db1dd67
Handling DUTY CYCLE more gracefully
clinique b964e45
Enhancing DUTY CYCLE
clinique ad5ec97
Moving to SNAPSHOT 3.4
clinique 40ce57f
Adress inconsistencies in binding name
clinique 5ddb78a
Discover Freebox Delta Home equipments(basic_shutter)
ben12 f8e5aff
Clean previous test code
ben12 c1e9fb3
Fix "Unexpected command"
ben12 e23ae88
Fix thing comm error
ben12 08196f0
README for basic shutter
ben12 e6d77f1
Fix MR discusions and solve maven check errors and warnings
ben12 8dc8d93
Fix MR discusions
ben12 81469e5
Fix README.md
ben12 d58bb3e
Enhancing logging to indentify source of erratic warn
clinique cb32b42
Deny polling a device data when its API is needed and it is OFFLINE
clinique 9b3dd72
Taking #11833 in accound
clinique 815643d
Switching to Snapshot 4.0.0
clinique 7e1a2df
Implementing SHUTTER Home Node
clinique f437308
Saving work before instroduction of ArrayListDeserializer
clinique 376de7b
Enhanced deserialization to simplify code
clinique 1338f19
Switching to Java 17 records
clinique b0fcb9a
Switching to addons.xml, headers updated
clinique 54c0821
Correcting two errors.
clinique 5402d26
Enhance usage of global variables
clinique fdf9368
Some code enhancement for base classes
clinique 48d259e
solving SAT issues
clinique c18dd67
Adding IliadBox compatibility
clinique 0f86e03
Commiting work
clinique 6c9028c
Saving work
clinique 3880b77
Rebooting Home Node part
clinique c2877a8
Spotless apply
clinique 4f7aa82
Adding i18n
clinique a320471
Decreasing websocket logging level
clinique 83060e5
SAT warnings handling
clinique 4802a15
Correcting potential NPE
clinique 1003584
Correcting a NPE on error
clinique 38178f3
Active player request falls to incorrect API version
clinique 74c99cc
Reintroducing missing capability to send keys to player.
clinique 6d868b5
Handling DUTY CYCLE more gracefully
clinique d54a254
Enhancing DUTY CYCLE
clinique f5a049e
Moving to SNAPSHOT 3.4
clinique 7280ac4
Adress inconsistencies in binding name
clinique 7b0b790
Discover Freebox Delta Home equipments(basic_shutter)
ben12 a328839
Clean previous test code
ben12 52b9ac2
Fix "Unexpected command"
ben12 a6e57bc
Fix thing comm error
ben12 814deab
README for basic shutter
ben12 8728703
Fix MR discusions and solve maven check errors and warnings
ben12 0bdfc0d
Fix MR discusions
ben12 6809d6d
Fix README.md
ben12 23ead80
Enhancing logging to indentify source of erratic warn
clinique f12259c
Deny polling a device data when its API is needed and it is OFFLINE
clinique 564e07a
Taking #11833 in accound
clinique df778a2
Switching to Snapshot 4.0.0
clinique 4e1b84d
Implementing SHUTTER Home Node
clinique bab969a
Saving work before instroduction of ArrayListDeserializer
clinique 29f1499
Enhanced deserialization to simplify code
clinique 0e70eed
Switching to Java 17 records
clinique b4177dd
Switching to addons.xml, headers updated
clinique 29270ae
Correcting two errors.
clinique c6edc35
Enhance usage of global variables
clinique c669dd8
Some code enhancement for base classes
clinique d8f7331
solving SAT issues
clinique dcb36b0
Adding IliadBox compatibility
clinique cb2d7e7
Commiting work
clinique bfa9e1f
Saving work
clinique 0e6b3f2
Rebooting Home Node part
clinique 9618d06
Spotless apply
clinique 8ba0271
Enhancing SAT report
clinique efd7c3e
I think that mvn spotless:apply has a problem with records - trying o…
clinique 2fcba0a
Avoid requesting detailed information for a shutdown repeater.
clinique f638cb0
Switched fan speed to RPM unit
clinique fc920d5
Correcting SAT
clinique 905a671
Correcting SAT
clinique e3137db
Divergence between eclipse and mvn spotless:apply
clinique 50991bc
YASAT
clinique c3e9434
Corrections following fwolter code review
clinique bd41053
Pleasing SAT
clinique 14adc08
Second fwolter code review
clinique df30151
Porting modifications introduced in PR #15121
clinique d9712cc
Removing redundant null checks.
clinique e07249f
Rebased.
clinique f05d318
Trying to remove the last sleep.
clinique 76f82f1
Reporting modifications of PR #15121
clinique dabbc2f
Reverting to working and cleaner granting process
clinique 4a6e835
Removing last Thread:Sleep
clinique adeb086
spotless:apply
clinique File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
<artifactId>gson</artifactId> | ||
<version>2.10.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.seancfoley</groupId> | ||
<artifactId>ipaddress</artifactId> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The license of this dependency needs to be added to NOTICE. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
<version>5.4.0</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
10 changes: 10 additions & 0 deletions
10
bundles/org.openhab.binding.freeboxos/src/main/feature/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
176 changes: 176 additions & 0 deletions
176
...boxos/src/main/java/org/openhab/binding/freeboxos/internal/FreeboxOsBindingConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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