Skip to content

Commit

Permalink
Fix invalid volume slider position on media_player
Browse files Browse the repository at this point in the history
Resolves #25
  • Loading branch information
olicooper committed Oct 20, 2024
1 parent 437225c commit 6f6eb36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/nspanel_lovelace/cards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ std::string &MediaCard::render(std::string &buffer) {
buffer.append(2, SEPARATOR);

buffer.append(std::to_string(
std::stoi(this->media_entity_->get_attribute(
ha_attr_type::volume_level, "0")) * 100));
static_cast<uint8_t>(std::stof(this->media_entity_->get_attribute(
ha_attr_type::volume_level, "0")) * 100.0f)));
buffer.append(1, SEPARATOR);

auto icon = this->media_entity_->is_state(entity_state::playing)
Expand Down

0 comments on commit 6f6eb36

Please sign in to comment.