This repository has been archived on 2023-08-29. You can view files and clone it, but cannot push or open issues or pull requests.
automation/device/internal_name.go
Dreaded_X c091ad0782
Some checks failed
continuous-integration/drone/push Build is failing
Finished major refactor
2022-11-19 03:50:12 +01:00

34 lines
496 B
Go

package device
import "strings"
type InternalName string
func (n InternalName) Room() string {
s := strings.Split(string(n), "/")
room := ""
if len(s) > 1 {
room = s[0]
}
room = strings.ReplaceAll(room, "_", " ")
room = strings.Title(room)
return room
}
func (n InternalName) Name() string {
s := strings.Split(string(n), "/")
name := s[0]
if len(s) > 1 {
name = s[1]
}
name = strings.Title(name)
return name
}
func (n InternalName) String() string {
return string(n)
}