MCPcopy Create free account
hub / github.com/drosoCode/atvremote / GetData

Method GetData

pkg/v2/command/command.go:207–218  ·  view source on GitHub ↗

Return informations on the current android tv device

()

Source from the content-addressed store, hash-verified

205
206// Return informations on the current android tv device
207func (c *Command) GetData() (RemoteData, error) {
208 start := time.Now()
209 c.sendConfiguration()
210 // wait until data is available
211 for start.After(c.RemoteData.Powered.UpdateDate) || start.After(c.RemoteData.Device.UpdateDate) || start.After(c.RemoteData.App.UpdateDate) {
212 // timeout after 3 seconds
213 if time.Since(start) > time.Second*3 {
214 return c.RemoteData, errors.New("unable to fully retreive data")
215 }
216 }
217 return c.RemoteData, nil
218}
219
220// send a configuration message to the android tv device
221func (c *Command) sendConfiguration() error {

Callers 1

ExecuteFunction · 0.80

Calls 1

sendConfigurationMethod · 0.95

Tested by

no test coverage detected