-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Landingpage add core checks before show errors #24493
base: dev
Are you sure you want to change the base?
Conversation
this._networkInfoError = false; | ||
this._coreStatusChecked = false; | ||
} catch (err) { | ||
if (!this._coreStatusChecked) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we also check supervisor status here, so do a _pingSupervisor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just check core if ping works?
No we should check core when ping or network info fails, just in case it's already there.
@@ -137,18 +118,29 @@ class HaLandingPage extends LandingPageBaseElement { | |||
|
|||
private async _fetchSupervisorInfo(schedule = false) { | |||
try { | |||
if (!this._networkInfo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we only ping once? are we sure that supervisor wont go down after we have a ping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it should not go down till core starts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it goes down when it updates, are we sure it will be done for update before we do the first check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understood it like this but I'll recheck
await waitForSeconds(CORE_CHECK_SECONDS); | ||
// wait before show errors, because we assume that core is starting | ||
this._coreCheckActive = true; | ||
this._turnOfCoreCheck(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this._scheduleTurnOffCoreCheck();
landing-page/src/ha-landing-page.ts
Outdated
import { | ||
getSupervisorNetworkInfo, | ||
pingSupervisor, | ||
type NetworkInfo, | ||
} from "./data/supervisor"; | ||
|
||
export const CORE_CHECK_SECONDS = 5; | ||
export const ASSUME_CORE_START_SECONDS = 30; | ||
export const SCHEDULE_CORE_CHECK_SECONDS = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used? We only check core status once now?
|
||
const SCHEDULE_CORE_CHECK_SECONDS = 5; | ||
export const ASSUME_CORE_START_SECONDS = 30; | ||
export const SCHEDULE_CORE_CHECK_SECONDS = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const SCHEDULE_CORE_CHECK_SECONDS = 1; | |
const SCHEDULE_CORE_CHECK_SECONDS = 1; |
Proposed change
Closes home-assistant/landingpage#147
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: