Compare commits
17 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dcb51d450f | ||
|
|
f8d7b55b16 | ||
|
|
cc8b85f436 | ||
|
|
58b248a39d | ||
|
|
7d91386376 | ||
|
|
25f71a283e | ||
|
|
dc49095536 | ||
|
|
648f31df87 | ||
|
|
7f4722481c | ||
|
|
e76d2a94c8 | ||
|
|
0cf1fa2d69 | ||
|
|
418d0a93f4 | ||
|
|
b5d1edefdc | ||
|
|
9693290980 | ||
|
|
de1b3d9115 | ||
|
|
e0a37547a2 | ||
|
|
6506291d39 |
4 changed files with 34 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
/usbrelay-1.1.2.tar.gz
|
||||
/usbrelay-1.2.tar.gz
|
||||
/usbrelay-1.2.1.tar.gz
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (usbrelay-1.2.tar.gz) = 9bde33d2464f46ae5acd451d1606bc9f79c815fd54ac73d79e9e7a968dfcb82981759232f9705c50def331720c0a6384bf25c0fd9e6181ff6bb29615dce9e79f
|
||||
SHA512 (usbrelay-1.2.1.tar.gz) = a051201d3c34db9e59aae5e61011360a76fcd6e7dbc857540fc311ff93c8a0d90c51c11fe9e35273eebda0f179515ec7c455575d1bdf09c15af8be0c095459a2
|
||||
|
|
|
|||
28
usbrelay-paho-mqttv2.patch
Normal file
28
usbrelay-paho-mqttv2.patch
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
From 58fed08a2a1b10122360845c780c9fa17cf9d6b3 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Sojka <michal.sojka@cvut.cz>
|
||||
Date: Tue, 30 Apr 2024 14:03:40 +0200
|
||||
Subject: [PATCH] usbrelayd: Add support for paho-mqtt >= 2.0.0
|
||||
|
||||
See https://eclipse.dev/paho/files/paho.mqtt.python/html/migrations.html#change-between-version-1-x-and-2-0
|
||||
---
|
||||
usbrelayd | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/usbrelayd b/usbrelayd
|
||||
index 60c13dc..10bfe1e 100644
|
||||
--- a/usbrelayd
|
||||
+++ b/usbrelayd
|
||||
@@ -95,7 +95,12 @@ else:
|
||||
# connect to the mqtt broker
|
||||
|
||||
|
||||
-client = mqtt.Client(clientName)
|
||||
+if "CallbackAPIVersion" in dir(mqtt):
|
||||
+ # paho-mqtt >= 2.0.0
|
||||
+ client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, clientName)
|
||||
+else:
|
||||
+ # paho-mqtt < 2.0.0
|
||||
+ client = mqtt.Client(clientName)
|
||||
client.connect(mqttBroker)
|
||||
publish_states(client)
|
||||
client.on_message=on_message
|
||||
|
|
@ -1,20 +1,17 @@
|
|||
Name: usbrelay
|
||||
Version: 1.2
|
||||
Version: 1.2.1
|
||||
Release: %autorelease
|
||||
Summary: A library and command line tool to control USB-connected relays based on hidapi
|
||||
License: GPL-2.0-or-later
|
||||
URL: https://github.com/darrylb123/%{name}
|
||||
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
# https://github.com/darrylb123/usbrelay/pull/112
|
||||
Patch1: usbrelay-paho-mqttv2.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: hidapi-devel
|
||||
BuildRequires: make
|
||||
BuildRequires: python3
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: python3-toml
|
||||
BuildRequires: python3-wheel
|
||||
BuildRequires: python3-tox-current-env
|
||||
BuildRequires: systemd-rpm-macros
|
||||
Requires: systemd-udev
|
||||
|
||||
|
|
@ -141,7 +138,6 @@ groupadd --force --system usbrelay
|
|||
%{python3_sitearch}/%{name}_py*.dist-info
|
||||
%{python3_sitearch}/%{name}
|
||||
|
||||
|
||||
%files mqtt
|
||||
%{_sbindir}/usbrelayd
|
||||
%{_unitdir}/usbrelayd.service
|
||||
|
|
@ -153,6 +149,7 @@ groupadd --force --system usbrelay
|
|||
%files devel
|
||||
%{_includedir}/libusbrelay.h
|
||||
%{_libdir}/libusbrelay.so
|
||||
%{_libdir}/pkgconfig/libusbrelay.pc
|
||||
|
||||
|
||||
%changelog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue