feat: Enhance MK2 driver with device state management and improved command handling
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-19 13:13:19 +11:00
parent e17e4d1a0a
commit e995a252e1
6 changed files with 917 additions and 36 deletions

View File

@@ -8,6 +8,8 @@ type mock struct {
c chan *Mk2Info
}
var _ ProtocolControl = (*mock)(nil)
func NewMk2Mock() Mk2 {
tmp := &mock{
c: make(chan *Mk2Info, 1),
@@ -53,6 +55,49 @@ func (m *mock) SetStandby(_ bool) error {
return nil
}
func (m *mock) GetDeviceState() (DeviceState, error) {
return DeviceStateOn, nil
}
func (m *mock) SetDeviceState(_ DeviceState) error {
return nil
}
func (m *mock) ReadRAMVarByID(_ uint16) (int16, error) {
return 0, nil
}
func (m *mock) ReadSettingByID(_ uint16) (int16, error) {
return 0, nil
}
func (m *mock) SelectRAMVar(_ uint16) error {
return nil
}
func (m *mock) SelectSetting(_ uint16) error {
return nil
}
func (m *mock) ReadSelected() (int16, error) {
return 0, nil
}
func (m *mock) ReadRAMVarInfo(id uint16) (RAMVarInfo, error) {
return RAMVarInfo{
ID: id,
Supported: false,
}, nil
}
func (m *mock) WriteSettingByID(_ uint16, _ int16) error {
return nil
}
func (m *mock) WriteRAMVarByID(_ uint16, _ int16) error {
return nil
}
func (m *mock) genMockValues() {
mult := 1.0
ledState := LedOff