Documentation
¶
Index ¶
- type BatteryBody
- type BatteryPlugin
- func (p *BatteryPlugin) Handle(ctx context.Context, dev device.Sender, pkt *protocol.Packet) error
- func (p *BatteryPlugin) IncomingTypes() []string
- func (p *BatteryPlugin) Name() string
- func (p *BatteryPlugin) OnConnect(dev device.Sender)
- func (p *BatteryPlugin) OnDisconnect(_ device.Sender)
- func (p *BatteryPlugin) OutgoingTypes() []string
- func (p *BatteryPlugin) Timeout() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatteryBody ¶
type BatteryBody struct {
CurrentCharge int `json:"currentCharge"`
IsCharging bool `json:"isCharging"`
ThresholdEvent int `json:"thresholdEvent"`
}
BatteryBody represents the body of a kdeconnect.battery packet.
type BatteryPlugin ¶
type BatteryPlugin struct {
// contains filtered or unexported fields
}
BatteryPlugin handles incoming battery state updates.
func NewBatteryPlugin ¶ added in v1.0.5
func NewBatteryPlugin(cfg config.BatteryConfig, bus *events.Bus, logger *zap.Logger) *BatteryPlugin
NewBatteryPlugin creates a BatteryPlugin.
func (*BatteryPlugin) IncomingTypes ¶
func (p *BatteryPlugin) IncomingTypes() []string
func (*BatteryPlugin) Name ¶
func (p *BatteryPlugin) Name() string
func (*BatteryPlugin) OnConnect ¶
func (p *BatteryPlugin) OnConnect(dev device.Sender)
OnConnect requests the phone's battery and sends our local battery state.
func (*BatteryPlugin) OnDisconnect ¶
func (p *BatteryPlugin) OnDisconnect(_ device.Sender)
func (*BatteryPlugin) OutgoingTypes ¶
func (p *BatteryPlugin) OutgoingTypes() []string
func (*BatteryPlugin) Timeout ¶
func (p *BatteryPlugin) Timeout() time.Duration
Click to show internal directories.
Click to hide internal directories.