diff --git a/src/components/ha-gauge.ts b/src/components/ha-gauge.ts
index a33ba30cf2..6cb3391f2e 100644
--- a/src/components/ha-gauge.ts
+++ b/src/components/ha-gauge.ts
@@ -9,6 +9,7 @@ import {
} from "lit-element";
import { styleMap } from "lit-html/directives/style-map";
import { afterNextRender } from "../common/util/render-status";
+import { ifDefined } from "lit-html/directives/if-defined";
const getAngle = (value: number, min: number, max: number) => {
const percentage = getValueInPercentage(normalize(value, min, max), min, max);
@@ -27,6 +28,9 @@ const getValueInPercentage = (value: number, min: number, max: number) => {
return (100 * newVal) / newMax;
};
+// Workaround for https://github.com/home-assistant/frontend/issues/6467
+const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
+
@customElement("ha-gauge")
export class Gauge extends LitElement {
@property({ type: Number }) public min = 0;
@@ -69,9 +73,28 @@ export class Gauge extends LitElement {
>
+ style=${ifDefined(
+ !isSafari
+ ? styleMap({ transform: `rotate(${this._angle}deg)` })
+ : undefined
+ )}
+ transform=${ifDefined(
+ isSafari ? `rotate(${this._angle} 50 50)` : undefined
+ )}
+ >
+ ${
+ isSafari
+ ? svg``
+ : ""
+ }
+