Home Assistant: add features config (heating/integrateddevice) (#32288)
This commit is contained in:
parent
c9c3b3b738
commit
838773b2ae
1 changed files with 3 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import (
|
||||||
|
|
||||||
// HomeAssistant charger implementation
|
// HomeAssistant charger implementation
|
||||||
type HomeAssistant struct {
|
type HomeAssistant struct {
|
||||||
|
*embed
|
||||||
implement.Caps
|
implement.Caps
|
||||||
conn *homeassistant.Connection
|
conn *homeassistant.Connection
|
||||||
status string
|
status string
|
||||||
|
|
@ -29,6 +30,7 @@ func init() {
|
||||||
// NewHomeAssistantFromConfig creates a HomeAssistant charger from generic config
|
// NewHomeAssistantFromConfig creates a HomeAssistant charger from generic config
|
||||||
func NewHomeAssistantFromConfig(other map[string]any) (api.Charger, error) {
|
func NewHomeAssistantFromConfig(other map[string]any) (api.Charger, error) {
|
||||||
var cc struct {
|
var cc struct {
|
||||||
|
embed `mapstructure:",squash"`
|
||||||
homeassistant.Config `mapstructure:",squash"`
|
homeassistant.Config `mapstructure:",squash"`
|
||||||
Status string // required - sensor for charge status
|
Status string // required - sensor for charge status
|
||||||
StatusA string // optional - custom states mapped to status A
|
StatusA string // optional - custom states mapped to status A
|
||||||
|
|
@ -74,6 +76,7 @@ func NewHomeAssistantFromConfig(other map[string]any) (api.Charger, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c := &HomeAssistant{
|
c := &HomeAssistant{
|
||||||
|
embed: &cc.embed,
|
||||||
Caps: implement.New(),
|
Caps: implement.New(),
|
||||||
conn: conn,
|
conn: conn,
|
||||||
status: cc.Status,
|
status: cc.Status,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue