Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
z2m
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xAAL
Code
Go
z2m
Commits
bc72b239
Commit
bc72b239
authored
4 months ago
by
KERDREUX Jerome
Browse files
Options
Downloads
Patches
Plain Diff
Fix mqqtTopic global
I guess I missed a push on git.. so back port this missing stuff.
parent
e395ceb3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config.go
+0
-1
0 additions, 1 deletion
config.go
gateway.go
+1
-1
1 addition, 1 deletion
gateway.go
z2m.go
+3
-1
3 additions, 1 deletion
z2m.go
with
4 additions
and
3 deletions
config.go
+
0
−
1
View file @
bc72b239
...
...
@@ -10,7 +10,6 @@ import (
)
var
(
mqttTopic
=
"zigbee2mqtt"
mqttClientID
=
"z2m-"
+
uuid
.
New
()
.
String
()
ignoredTopics
=
[]
string
{
"bridge/groups"
,
...
...
This diff is collapsed.
Click to expand it.
gateway.go
+
1
−
1
View file @
bc72b239
...
...
@@ -34,8 +34,8 @@ func (gw *Gateway) AddZDevice(zDev *Z2MDevice) {
slog
.
Debug
(
"Adding device"
,
"dev"
,
dev
.
String
())
gw
.
Engine
.
AddDevice
(
dev
)
}
gw
.
Devices
[
zDev
.
FriendlyName
]
=
zDev
zDev
.
Gateway
=
gw
gw
.
Devices
[
zDev
.
FriendlyName
]
=
zDev
}
func
(
gw
*
Gateway
)
RemoveZDevice
(
zDev
*
Z2MDevice
)
{
...
...
This diff is collapsed.
Click to expand it.
z2m.go
+
3
−
1
View file @
bc72b239
...
...
@@ -61,7 +61,7 @@ type Feature struct {
// returns the topic for the device
func
(
zDev
*
Z2MDevice
)
getTopic
()
string
{
return
mqttT
opic
+
"/"
+
zDev
.
FriendlyName
return
zDev
.
Gateway
.
Config
.
t
opic
+
"/"
+
zDev
.
FriendlyName
}
// return the expose with the given name
...
...
@@ -90,6 +90,8 @@ func (zDev *Z2MDevice) HandleMessage(msg mqtt.Message) {
// creates new xAAL devices from a bridge device
func
(
zDev
*
Z2MDevice
)
FindXAALDevices
(
gw
*
Gateway
)
{
// There is a trick here. We call FindXAALDevices w/ gw argument, but the Gateway is only set
// in the AddZDevice method. This is not mandatory but avoid to have Gateway at random place
baseAddr
:=
gw
.
Config
.
baseAddr
ieeeAddr
,
_
:=
hexStringToInteger
(
zDev
.
IeeeAddress
)
baseAddr
,
_
=
baseAddr
.
Add
(
int64
(
ieeeAddr
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment