Skip to content

Commit

Permalink
style fix + readme
Browse files Browse the repository at this point in the history
metallkopf committed Aug 17, 2021
1 parent e9cf421 commit 77231ec
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion konnect/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

__version__ = "0.1.1"
__version__ = "0.1.2"
2 changes: 1 addition & 1 deletion konnect/client.py
Original file line number Diff line number Diff line change
@@ -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")

5 changes: 3 additions & 2 deletions konnect/packet.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 77231ec

Please sign in to comment.