diff --git a/README.md b/README.md index f10a8dd..cc67627 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ optional arguments: | DELETE | /device/(id\|name)/:value | Unpair | | | PUT | /announce | Announce identity | | | POST | /ping/(id\|name)/:value | Ping device | | +| POST | /ring/(id\|name)/:value | Ring device | | | POST | /notification/(id\|name)/:value | Send notification | text, title, application, reference (optional) | | DELETE | /notification/(id\|name)/:value/:reference | Cancel notification | | @@ -115,7 +116,7 @@ konnect --help ``` ``` usage: konnect.py [--port PORT] - (--devices | --announce | --command {info,pair,unpair,ping,notification,cancel} | --help) + (--devices | --announce | --command {info,pair,unpair,ping,ring,notification,cancel} | --help) [--identifier ID | --name NAME] [--text TEXT] [--title TITLE] [--application APP] [--reference REF] [--reference2 REF2] @@ -125,7 +126,7 @@ optional arguments: arguments: --devices List all devices --announce Search for devices in the network - --command {info,pair,unpair,ping,notification,cancel} + --command {info,pair,unpair,ping,ring,notification,cancel} --help This help command arguments: @@ -192,5 +193,8 @@ Tested *manually* on [kdeconnect](https://invent.kde.org/kde/kdeconnect-kde) 1.3 - Run commands? - Standardize rest resources? +## Contributor(s) +- coxtor + ## License [GPLv2](https://www.gnu.org/licenses/gpl-2.0.html) diff --git a/konnect/__init__.py b/konnect/__init__.py index abe9369..47f13fe 100644 --- a/konnect/__init__.py +++ b/konnect/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.1.1" +__version__ = "0.1.2" diff --git a/konnect/client.py b/konnect/client.py index 270ee20..e810ec5 100755 --- a/konnect/client.py +++ b/konnect/client.py @@ -17,7 +17,7 @@ def main(): main = root.add_mutually_exclusive_group(required=True) main.add_argument("--devices", action="store_true", help="List all devices") main.add_argument("--announce", action="store_true", help="Search for devices in the network") - main.add_argument("--command", choices=["info", "pair", "unpair","ring", "ping", "notification", "cancel"]) + main.add_argument("--command", choices=["info", "pair", "unpair", "ring", "ping", "notification", "cancel"]) main.add_argument("--help", action="store_true", help="This help") main.add_argument("--version", action="store_true", help="Version information") diff --git a/konnect/packet.py b/konnect/packet.py index 96a1725..4c12cf1 100644 --- a/konnect/packet.py +++ b/konnect/packet.py @@ -11,6 +11,7 @@ class PacketType: PING = "kdeconnect.ping" RING = "kdeconnect.findmyphone.request" + class Packet: PROTOCOL_VERSION = 7 DEVICE_TYPE = "desktop" @@ -53,7 +54,7 @@ def createIdentity(identifier, name, port): packet.set("deviceType", Packet.DEVICE_TYPE) packet.set("tcpPort", port) packet.set("incomingCapabilities", [PacketType.PING]) - packet.set("outgoingCapabilities", [PacketType.RING,PacketType.NOTIFICATION, PacketType.PING]) + packet.set("outgoingCapabilities", [PacketType.RING, PacketType.NOTIFICATION, PacketType.PING]) return packet @@ -72,7 +73,7 @@ def createNotification(text, title, application, reference): packet.set("title", title) packet.set("text", text) packet.set("isClearable", True) - packet.set(f"ticker", "{title}: {text}") + packet.set("ticker", f"{title}: {text}") return packet