mirror of
https://github.com/cmur2/miflorad.git
synced 2025-06-26 22:30:24 +02:00
munin-miflora: refactor helper into common, add RSSI and timing metrics
This commit is contained in:
14
common/misc.go
Normal file
14
common/misc.go
Normal file
@ -0,0 +1,14 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const peripheralAddressAllowedChars = "[^a-z0-9]+"
|
||||
|
||||
var peripheralAddressAllowedCharsPattern = regexp.MustCompile(peripheralAddressAllowedChars)
|
||||
|
||||
func MifloraGetAlphaNumericID(peripheralAddress string) string {
|
||||
return peripheralAddressAllowedCharsPattern.ReplaceAllString(strings.ToLower(peripheralAddress), "")
|
||||
}
|
Reference in New Issue
Block a user