1use crate::device::device::Connector;
2use crate::{ConnectState, FlowState};
3use serde::{Deserialize, Serialize};
4use std::fmt::{Debug, Formatter};
5
6#[derive(Serialize, Deserialize, Clone)]
7#[serde(rename_all = "camelCase")]
8pub struct Play {
9 pub url: String,
10 pub connect_to: String,
11}
12
13impl Connector for Play {
14 fn get_connect_to(&mut self, _state: &mut FlowState) -> ConnectState {
15 ConnectState::default(&self.connect_to, None)
16 }
17}
18
19impl Debug for Play {
20 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
21 f.debug_struct("Play")
22 .field("url", &self.url)
23 .field("connect_to", &self.connect_to)
24 .finish()
25 }
26}