Add 'muted' property to JSON output
This commit is contained in:
parent
60192e44fa
commit
888ea9758b
2 changed files with 9 additions and 0 deletions
|
@ -427,6 +427,7 @@ impl HomeAssistant {
|
|||
OutputFormat::Waybar => Waybar::builder()
|
||||
.text(text)
|
||||
.percentage((volume_raw * 100.) as u8)
|
||||
.muted(is_muted)
|
||||
.build()
|
||||
.to_string(),
|
||||
OutputFormat::I3Blocks => I3Blocks::builder().text(text).build().to_string(),
|
||||
|
|
|
@ -11,6 +11,7 @@ pub(crate) struct WaybarBuilder {
|
|||
tooltip: String,
|
||||
class: String,
|
||||
percentage: u8,
|
||||
muted: bool,
|
||||
}
|
||||
|
||||
impl WaybarBuilder {
|
||||
|
@ -43,6 +44,11 @@ impl WaybarBuilder {
|
|||
self
|
||||
}
|
||||
|
||||
pub(crate) fn muted(mut self, muted: bool) -> Self {
|
||||
self.muted = muted;
|
||||
self
|
||||
}
|
||||
|
||||
pub(crate) fn build(self) -> Waybar {
|
||||
Waybar {
|
||||
text: self.text,
|
||||
|
@ -50,6 +56,7 @@ impl WaybarBuilder {
|
|||
tooltip: self.tooltip,
|
||||
class: self.class,
|
||||
percentage: self.percentage,
|
||||
muted: self.muted
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +68,7 @@ pub(crate) struct Waybar {
|
|||
tooltip: String,
|
||||
class: String,
|
||||
percentage: u8,
|
||||
muted: bool,
|
||||
}
|
||||
|
||||
impl Waybar {
|
||||
|
|
Loading…
Reference in a new issue