Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General fixes #1514

Merged
merged 5 commits into from
Mar 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions frontend/src/Components/Configuration/Configuration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import CardContent from "@material-ui/core/CardContent";
import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";

import { HomeAssistantEntityProps } from "../HomeAssistant/HomeAssistant";
import { sections, ConfigProps, ConfigSection } from "./Config";
import Section from "./Section";

Expand All @@ -27,7 +26,7 @@ const useStyles = makeStyles((theme: Theme) => ({
},
}));

interface ConfigurationBaseProps extends ConfigProps, HomeAssistantEntityProps {
interface ConfigurationBaseProps extends ConfigProps {
handleBackupConfig: () => void;
handleRestoreConfig: () => void;
}
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/Components/Configuration/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import Visibility from "@material-ui/icons/Visibility";
import VisibilityOff from "@material-ui/icons/VisibilityOff";

import { ConfigurationProps } from "./Configuration";
import { HomeAssistantEntityProps } from "../HomeAssistant/HomeAssistant";
import { ConfigSectionItem } from "./Config";
import clone from "../../utils/clone";
import ColorAdornment from "../Utils/ColorAdornment";
Expand Down Expand Up @@ -61,7 +60,7 @@ const useStyles = makeStyles((theme: Theme) => ({
},
}));

interface ItemProps extends ConfigurationProps, HomeAssistantEntityProps {
interface ItemProps extends ConfigurationProps {
item: ConfigSectionItem;
}

Expand Down
5 changes: 1 addition & 4 deletions frontend/src/Components/Configuration/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Typography from "@material-ui/core/Typography";
import ReactMarkdown from "react-markdown";

import { ConfigurationProps } from "./Configuration";
import { HomeAssistantEntityProps } from "../HomeAssistant/HomeAssistant";
import Item from "./Item";
import { ConfigSectionItem } from "./Config";

Expand All @@ -28,9 +27,7 @@ const useStyles = makeStyles((theme: Theme) => ({
},
}));

interface SectionProps extends ConfigurationProps, HomeAssistantEntityProps {}

function Section(props: SectionProps): ReactElement {
function Section(props: ConfigurationProps): ReactElement {
const classes = useStyles();

return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/HomeAssistant/Cards/Light.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function Light(props: EntityProps): ReactElement | null {
});
};

const controls = [];
const controls: Array<ReactElement> = [];

if (attrClasses.includes("has-brightness"))
controls.push(
Expand Down
22 changes: 8 additions & 14 deletions frontend/src/Components/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ function Main(props: MainProps): ReactElement {
}, []);

useEffect(() => {
if (hassConnection === -2) {
const haUrl = localStorage.getItem("hass_url");
if (haUrl) {
setHassUrl(haUrl);
setHassConnection(-1);
}
}
// if (hassConnection === -2) {
// const haUrl = localStorage.getItem("hass_url");
// if (haUrl) {
// setHassUrl(haUrl);
// setHassConnection(-1);
// }
// }
}, [hassConnection]);

function handleUpdateConfig(path: (string | number)[], data?: unknown): void {
Expand Down Expand Up @@ -246,16 +246,10 @@ function Main(props: MainProps): ReactElement {
setEntities={setHassEntities}
/>
)}
{props.currentPage === "Configuration" &&
hassAuth &&
hassConfig &&
hassEntities ? (
{props.currentPage === "Configuration" ? (
<Configuration
{...props}
editing={editing}
hassAuth={hassAuth}
hassConfig={hassConfig}
hassEntities={hassEntities}
handleBackupConfig={handleBackupConfig}
handleRestoreConfig={handleRestoreConfig}
handleUpdateConfig={handleUpdateConfig}
Expand Down
5 changes: 4 additions & 1 deletion frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"noEmit": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitThis": false,
"jsx": "react-jsx"
},
"include": ["src"]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"prettier-yml": "prettier --write ./**/*.yml"
},
"devDependencies": {
"@types/node": "14.14.35",
"@typescript-eslint/eslint-plugin": "4.18.0",
"@typescript-eslint/parser": "4.18.0",
"eslint": "7.22.0",
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15324,6 +15324,7 @@ resolve@1.18.1:
version: 0.0.0-use.local
resolution: "root-workspace-0b6124@workspace:."
dependencies:
"@types/node": 14.14.35
"@typescript-eslint/eslint-plugin": 4.18.0
"@typescript-eslint/parser": 4.18.0
eslint: 7.22.0
Expand Down