Compare commits

..

9 Commits
main ... test

Author SHA1 Message Date
44cfcad935
FIX: fixed path names
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-02 09:51:41 +01:00
5c2db6444f
FIX: fixed ci/cd
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:49:57 +01:00
473f71772c
FIX: fixed path names
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:46:26 +01:00
6a0295d5c9
FIX: fixed path names
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:44:38 +01:00
3b5aa7419d
FIX: fixed path names
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:40:15 +01:00
93f8462f1e
FIX: enforce long name of source container
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:38:39 +01:00
7efca653e6
FIX: added git to build container
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:37:01 +01:00
d5a3804136
FIX: added git to build container
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:31:07 +01:00
5ae4068bec
ADD: started ci/cd
Some checks failed
continuous-integration/drone Build is failing
2024-03-02 09:25:24 +01:00
5 changed files with 12 additions and 63 deletions

View File

@ -5,8 +5,6 @@ platform:
arch: amd64
node_selector:
kubernetes.io/arch: amd64
federationhq.de/location: Blumendorf
federationhq.de/compute: true
volumes:
- name: fedhq-ca-crt
@ -18,14 +16,12 @@ volumes:
steps:
- name: generate control
image: debian:bookworm
pull: always
commands:
- apt-get -qy update && apt-get -qy install git
- scripts/generate_control.sh
- name: build amd64
image: quay.io/buildah/stable
pull: always
privileged: true
volumes:
- name: fedhq-ca-crt
@ -42,8 +38,6 @@ platform:
arch: arm64
node_selector:
kubernetes.io/arch: arm64
federationhq.de/location: Blumendorf
federationhq.de/compute: true
volumes:
- name: fedhq-ca-crt
@ -55,14 +49,12 @@ volumes:
steps:
- name: generate control
image: debian:bookworm
pull: always
commands:
- apt-get -qy update && apt-get -qy install git
- scripts/generate_control.sh
- name: build arm64
image: quay.io/buildah/stable
pull: always
privileged: true
volumes:
- name: fedhq-ca-crt
@ -77,8 +69,6 @@ type: kubernetes
name: push
node_selector:
kubernetes.io/arch: amd64
federationhq.de/location: Blumendorf
federationhq.de/compute: true
volumes:
- name: fedhq-ca-crt
@ -90,7 +80,6 @@ volumes:
steps:
- name: push
image: quay.io/buildah/stable
pull: always
privileged: true
volumes:
- name: fedhq-ca-crt

View File

@ -1,5 +1,5 @@
FROM docker.io/nginx:latest
COPY FHEM /usr/share/nginx/html/FHEM/
COPY FHEM /usr/share/nginx/html/
COPY controls_byterazor-fhem-ntfy.txt /usr/share/nginx/html/
COPY CHANGED /usr/share/nginx/html/

View File

@ -140,7 +140,6 @@ sub NTFY_Define
$hash->{NAME} = $name;
$hash->{SERVER} = $params->[2];
$hash->{VERSION} = $VERSION;
$hash->{USERNAME} = $h->{user} || "";
$hash->{helper}{PASSWORD} = $h->{password};
$modules{NTFY_CLIENT}{defptr}{$hash->{SERVER}} = $hash;
@ -150,24 +149,16 @@ sub NTFY_Define
return;
}
sub NTFY_Get_Subscriptions
{
my $hash = shift;
my @subscriptions;
for my $k (keys %{$modules{NTFY_TOPIC}{defptr}})
{
$k=~/^(.*)_(.*)$/;
push(@subscriptions,$2);
}
return @subscriptions;
}
sub NTFY_Update_Subscriptions_Readings
{
my $hash = shift;
my @topics = NTFY_Get_Subscriptions($hash);
my @topics;
for my $k (keys %{$modules{NTFY_TOPIC}{defptr}})
{
$k=~/^(.*)_(.*)$/;
push(@topics,$2);
}
readingsSingleUpdate($hash,"subscriptions", join(",", @topics),1);
@ -230,7 +221,7 @@ sub NTFY_Publish_Msg
if ($msg->{priority})
{
$message->{priority} = int($msg->{priority});
$message->{priority} = $msg->{priority};
}
if ($msg->{keywords})

View File

@ -80,6 +80,7 @@ sub NTFY_TOPIC_Initialize
$hash->{WriteFn} = 'NTFY_TOPIC_Write';
$hash->{AttrFn} = 'NTFY_TOPIC_Attr';
$hash->{AttrList} = $readingFnAttributes;
$hash->{MatchList} = {"1:NTFY_CLIENT" => "^NTFY:.*"};
}
@ -121,7 +122,6 @@ sub NTFY_TOPIC_Define
$hash->{Clients} = "NTFY_CLIENT";
$hash->{ClientsKeepOrder} = 1;
$hash->{STATE} = "unknown";
$hash->{nextOpenDelay} = 20;
$modules{NTFY_TOPIC}{defptr}{$hash->{SERVER} . "_" . $hash->{TOPIC}} = $hash;
$attr{$hash->{NAME}}{room} = 'hidden';
@ -207,16 +207,9 @@ sub NTFY_WS_CB
sub NTFY_TOPIC_Read
{
my ( $hash ) = @_;
my ( $hash ) = @_;
my $buf = DevIo_SimpleRead($hash);
if (!$buf)
{
InternalTimer(gettimeofday()+30, "NTFY_TOPIC_Reconnect", $hash);
return;
}
return unless length($buf) > 0;
my $msg = from_json($buf);
@ -233,15 +226,4 @@ sub NTFY_TOPIC_Read
Dispatch($hash,"NTFY:" . $hash->{SERVER}. "---" . $buf,{},1);
}
sub NTFY_TOPIC_Reconnect
{
my $hash = shift;
if (!DevIo_IsOpen($hash))
{
NTFY_TOPIC_LOG(LOG_ERROR, "reconnecting websocket");
DevIo_OpenDev( $hash, 1, "NTFY_WS_Handshake", "NTFY_WS_CB" );
}
}
1;

View File

@ -20,19 +20,6 @@ that this is a sparetime project of someone with a family.
You will find the issue tracker at https://rm.byterazor.de/projects/fhem-ntfy.
## Installation
### Manual
just copy the files within the FHEM directory to you FHEM installations FHEM directory and restart the server
### FHEM Updates
On the FHEM command line run
update add https://rm.byterazor.de/upd-fhem-ntfy/controls_byterazor-fhem-ntfy.txt
update
## Authors
- Dominik Meyer <dmeyer@federationhq.de>