Skip to content

Commit

Permalink
Merge pull request #923 from tsightler/dev
Browse files Browse the repository at this point in the history
Release v5.7.2
  • Loading branch information
tsightler authored Nov 3, 2024
2 parents a4f849c + 4e2c1b2 commit e2931e1
Show file tree
Hide file tree
Showing 13 changed files with 984 additions and 599 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Auto detect text files and perform LF normalization
* text=auto
*.sh text
*.sh text eol=lf
*.js text eol=lf
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.20
FROM node:lts-alpine

ENV LANG="C.UTF-8" \
PS1="$(whoami)@$(hostname):$(pwd)$ " \
Expand All @@ -9,11 +9,11 @@ ENV LANG="C.UTF-8" \
TERM="xterm-256color"

COPY . /app/ring-mqtt
RUN S6_VERSION="v3.2.0.0" && \
RUN S6_VERSION="v3.2.0.2" && \
BASHIO_VERSION="v0.16.2" && \
GO2RTC_VERSION="v1.9.4" && \
APK_ARCH="$(apk --print-arch)" && \
apk add --no-cache tar xz git libcrypto3 libssl3 musl-utils musl bash curl jq tzdata nodejs npm mosquitto-clients && \
apk add --no-cache tar xz git bash curl jq tzdata mosquitto-clients && \
curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-noarch.tar.xz" | tar -Jxpf - -C / && \
case "${APK_ARCH}" in \
aarch64|armhf|x86_64) \
Expand Down
2 changes: 1 addition & 1 deletion devices/base-ring-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class RingDevice {
}

this.debug = (message, debugType) => {
utils.debug(debugType === 'disc' ? message : chalk.green(`[${this.deviceData.name}] `)+message, debugType ? debugType : 'mqtt')
utils.debug(debugType === 'disc' ? message : chalk.green(`[${this.deviceData.name}] `)+message, debugType || 'mqtt')
}
// Build device base and availability topic
this.deviceTopic = `${utils.config().ring_topic}/${this.locationId}/${category}/${this.deviceId}`
Expand Down
4 changes: 2 additions & 2 deletions devices/modes-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default class ModesPanel extends RingPolledDevice {
}
}

publishState(data) {
async publishState(data) {
const isPublish = Boolean(data === undefined)
const mode = (isPublish) ? this.device.location.getLocationMode() : data
const mode = (isPublish) ? (await this.device.location.getLocationMode()).mode : data
// Publish device state if it's changed from prior state
if (this.data.currentMode !== mode || isPublish) {
this.data.currentMode = mode
Expand Down
26 changes: 26 additions & 0 deletions devices/panic-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import RingSocketDevice from './base-socket-device.js'

export default class PanicButton extends RingSocketDevice {
constructor(deviceInfo) {
super(deviceInfo, 'alarm')
this.deviceData.mdl = 'Panic Button'


// Listen to raw data updates for all devices and log any events
this.device.location.onDataUpdate.subscribe(async (message) => {
if (!this.isOnline()) { return }

if (message.datatype === 'DeviceInfoDocType' &&
message.body?.[0]?.general?.v2?.zid === this.deviceId
) {
this.debug(JSON.stringify(message), 'data')
}
})

}

publishState() {
// This device only has attributes and attribute based entities
this.publishAttributes()
}
}
22 changes: 22 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## v5.7.2
**Bugs Fixed**
- Fix an isse that caused push notifications for camera/doorbell/intercom motion and ding events to stop working after interruptions in network connectivity lasting more than a few minutes.
- Fix an issue with Modes where the incorrect mode was sometimes published during initial startup. Thanks to @wahflz for the PR to address this!
- Fix a locking issue which prevented live and event streams from being active concurrently on the same camera.

**Dependency Updates**
- aedes 0.51.3
- body-parser 1.20.3
- date-fns 4.1.0
- debug 4.3.7
- express 4.21.1
- ffmpeg 7.0.2
- is-online 11.0.0
- mqtt 5.10.1
- node 22.11.0
- push-receiver 4.3.0
- ring-client-api 13.2.0-beta.1
- s6-overlay v3.2.0.2
- werift 0.20.1
- write-file-atomic 6.0.0

## v5.7.1
**New Features**
- Add experimental support for Zooz water valves. This support is currently untested, but was developed using user data dumps kindly contributed from several users and also based on a similar PR submitted for ring-homebridge from another user. Please feel free to open an issue on the Github project page if you have problems with this device and thanks to all involved for their support.
Expand Down
3 changes: 3 additions & 0 deletions lib/ring.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Keypad from '../devices/keypad.js'
import Lock from '../devices/lock.js'
import ModesPanel from '../devices/modes-panel.js'
import MultiLevelSwitch from '../devices/multi-level-switch.js'
import PanicButton from '../devices/panic-button.js'
import RangeExtender from '../devices/range-extender.js'
import SecurityPanel from '../devices/security-panel.js'
import Siren from '../devices/siren.js'
Expand Down Expand Up @@ -368,6 +369,8 @@ export default new class RingMqtt {
}
case RingDeviceType.WaterValve:
return new Valve(deviceInfo)
case 'security-remote':
return new PanicButton(deviceInfo)
case RingDeviceType.BeamsSwitch:
case 'access-code':
case 'access-code.vault':
Expand Down
4 changes: 3 additions & 1 deletion lib/streaming/peer-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ export class WeriftPeerConnection extends Subscribed {
})

this.pc.onIceCandidate.subscribe((iceCandidate) => {
this.onIceCandidate.next(iceCandidate)
if (iceCandidate) {
this.onIceCandidate.next(iceCandidate)
}
})

pc.iceConnectionStateChange.subscribe(() => {
Expand Down
2 changes: 1 addition & 1 deletion lib/streaming/streaming-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// to native Javascript with custom logging for ring-mqtt and some unused code removed.
// Much thanks to @dgreif for the original code which is the basis for this work.

import { FfmpegProcess, reservePorts, RtpSplitter, } from '@homebridge/camera-utils'
import { FfmpegProcess, reservePorts, RtpSplitter } from '@homebridge/camera-utils'
import { firstValueFrom, ReplaySubject, Subject } from 'rxjs'
import pathToFfmpeg from 'ffmpeg-for-homebridge'
import { concatMap, take } from 'rxjs/operators'
Expand Down
Loading

0 comments on commit e2931e1

Please sign in to comment.