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

fix geocoder which was accumulating state unnecessarily #190

Merged
merged 4 commits into from
Jun 5, 2024
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
22 changes: 0 additions & 22 deletions heat-stack/app/components/WeatherExample.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useForm, getInputProps } from '@conform-to/react'

Check warning on line 1 in heat-stack/app/components/ui/heat/CaseSummaryComponents/CurrentHeatingSystem.tsx

View workflow job for this annotation

GitHub Actions / ⬣ Heat-Stack - ESLint

'useForm' is defined but never used
import { Form } from '@remix-run/react'

Check warning on line 2 in heat-stack/app/components/ui/heat/CaseSummaryComponents/CurrentHeatingSystem.tsx

View workflow job for this annotation

GitHub Actions / ⬣ Heat-Stack - ESLint

'Form' is defined but never used
import { ErrorList } from './ErrorList.tsx'

Check warning on line 3 in heat-stack/app/components/ui/heat/CaseSummaryComponents/CurrentHeatingSystem.tsx

View workflow job for this annotation

GitHub Actions / ⬣ Heat-Stack - ESLint

`./ErrorList.tsx` import should occur after import of `#/app/components/ui/label.tsx`
import { Button } from '#/app/components/ui/button.tsx'

Check warning on line 4 in heat-stack/app/components/ui/heat/CaseSummaryComponents/CurrentHeatingSystem.tsx

View workflow job for this annotation

GitHub Actions / ⬣ Heat-Stack - ESLint

'Button' is defined but never used

import { Input } from '#/app/components/ui/input.tsx'
import { Label } from '#/app/components/ui/label.tsx'
Expand All @@ -23,55 +23,55 @@
{/* <Form method="post" action="/current"> */}
<div>
{' '}
<Label htmlFor="fuelType" className={`${subtitleClass}`}>
<Label htmlFor="fuel_type" className={`${subtitleClass}`}>
Fuel Type
</Label>
<div className="flex space-x-4">
<div className="basis-1/4">
<Input {...getInputProps(props.fields.fuelType, { type: "text" })} />
<Input {...getInputProps(props.fields.fuel_type, { type: "text" })} />
</div>
</div>
<div className="min-h-[32px] px-4 pb-3 pt-1">
<ErrorList
id={props.fields.fuelType.errorId}
errors={props.fields.fuelType.errors}
id={props.fields.fuel_type.errorId}
errors={props.fields.fuel_type.errors}
/>
</div>
</div>

<Label htmlFor="heatingSystemEfficiency" className={`${subtitleClass}`}>
<Label htmlFor="heating_system_efficiency" className={`${subtitleClass}`}>
Heating system efficiency %
</Label>
<div className="flex space-x-4">
<div className={`basis-1/3`}>
<Input placeholder="(Percent)" {...getInputProps(props.fields.heatingSystemEfficiency, { type: "text" })} />
<Input placeholder="(Percent)" {...getInputProps(props.fields.heating_system_efficiency, { type: "text" })} />
<div className={`${descriptiveClass}`}>
Typical natural gas efficiency is 80%-95%
</div>
<div className="min-h-[32px] px-4 pb-3 pt-1">
<ErrorList
id={props.fields.heatingSystemEfficiency.errorId}
errors={props.fields.heatingSystemEfficiency.errors}
id={props.fields.heating_system_efficiency.errorId}
errors={props.fields.heating_system_efficiency.errors}
/>
</div>
</div>
</div>

<Label htmlFor="designTemperatureOverride" className={`${subtitleClass}`}>
<Label htmlFor="design_temperature_override" className={`${subtitleClass}`}>
Design temperature override (°F)
</Label>
<div className="flex space-x-4">
<div className={`basis-1/3`}>
<Input placeholder="(Optional)" {...getInputProps(props.fields.designTemperatureOverride, { type: "text" })} />
<Input placeholder="(Optional)" {...getInputProps(props.fields.design_temperature_override, { type: "text" })} />
<div>
<div className={`${descriptiveClass}`}>
65°F is the 99% ASHRAE heating design temperature at this location
</div>
</div>
<div className="min-h-[32px] px-4 pb-3 pt-1">
<ErrorList
id={props.fields.designTemperatureOverride.errorId}
errors={props.fields.designTemperatureOverride.errors}
id={props.fields.design_temperature_override.errorId}
errors={props.fields.design_temperature_override.errors}
/>
</div>
</div>
Expand All @@ -81,41 +81,41 @@
<h6 className={`${subtitleClass}`}>Thermostat Settings</h6>
<div className="mt-4 flex space-x-4">
<div className="basis-1/3">
<Label htmlFor="thermostatSetPoint">
<Label htmlFor="thermostat_set_point">
<b>Set Point (°F)</b>{' '}
</Label>
<Input placeholder="(Fahrenheit)" {...getInputProps(props.fields.thermostatSetPoint, { type: "text" })} />
<Input placeholder="(Fahrenheit)" {...getInputProps(props.fields.thermostat_set_point, { type: "text" })} />
<div className={`${descriptiveClass}`}>
Usual thermostat setting for heating
</div>
<div className="min-h-[32px] px-4 pb-3 pt-1">
<ErrorList
id={props.fields.thermostatSetPoint.errorId}
errors={props.fields.thermostatSetPoint.errors}
id={props.fields.thermostat_set_point.errorId}
errors={props.fields.thermostat_set_point.errors}
/>
</div>
</div>
<div className="basis-1/3">
<Label htmlFor="setbackTemperature">
<Label htmlFor="setback_temperature">
<b>Setback Temperature (°F)</b>
</Label>
<Input placeholder="(Optional)" {...getInputProps(props.fields.setbackTemperature, { type: "text" })} />
<Input placeholder="(Optional)" {...getInputProps(props.fields.setback_temperature, { type: "text" })} />
<div className={`${descriptiveClass}`}>
Enter if thermostat is programmed to a lower or higher temperature
during working or sleep hours
</div>
<div className="min-h-[32px] px-4 pb-3 pt-1">
<ErrorList
id={props.fields.setbackTemperature.errorId}
errors={props.fields.setbackTemperature.errors}
id={props.fields.setback_temperature.errorId}
errors={props.fields.setback_temperature.errors}
/>
</div>
</div>
<div className="basis-1/3">
<Label htmlFor="setbackHoursPerDay">
<Label htmlFor="setback_hours_per_day">
<b>Setback hours per day</b>
</Label>
<Input placeholder="(Optional)" {...getInputProps(props.fields.setbackHoursPerDay, { type: "text" })} />
<Input placeholder="(Optional)" {...getInputProps(props.fields.setback_hours_per_day, { type: "text" })} />
<div className={`${descriptiveClass}`}>
Typical natural gas efficiency is 80%-95%
</div>
Expand All @@ -125,8 +125,8 @@
</div>
<div className="min-h-[32px] px-4 pb-3 pt-1">
<ErrorList
id={props.fields.setbackHoursPerDay.errorId}
errors={props.fields.setbackHoursPerDay.errors}
id={props.fields.setback_hours_per_day.errorId}
errors={props.fields.setback_hours_per_day.errors}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { HeatLoad } from './Graphs/HeatLoad.tsx'
import { WholeHomeUAComparison } from './Graphs/WholeHomeUAComparison.tsx'

export function Graphs() {
const fuelType = 'Natural Gas'
const fuel_type = 'Natural Gas'
const titleClassTailwind = 'text-5xl font-extrabold tracking-wide'
const componentMargin = 'mt-10'
return (
Expand All @@ -12,7 +12,7 @@ export function Graphs() {
Heat Load Analysis
</h2>
Fuel Type
{fuelType}
{fuel_type}
<AnalysisHeader />
<HeatLoad />
<WholeHomeUAComparison />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ export function HomeInformation(props: HomeInformationProps) {

<div className="mt-9">
<h6>
<Label className={`${subtitleClass}`} htmlFor="livingArea">
<Label className={`${subtitleClass}`} htmlFor="living_area">
Living Area (sf)
</Label>
</h6>

<div className="mt-4 flex space-x-2">
<div>
<Input {...getInputProps(props.fields.livingArea, { type: "text" })} />
<Input {...getInputProps(props.fields.living_area, { type: "text" })} />
<div className="min-h-[32px] px-4 pb-3 pt-1">
<ErrorList
id={props.fields.livingArea.errorId}
errors={props.fields.livingArea.errors}
id={props.fields.living_area.errorId}
errors={props.fields.living_area.errors}
/>
</div>
<p className={`${descriptiveClass}`}>
Expand Down
8 changes: 0 additions & 8 deletions heat-stack/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ import {
makeTimings,
time,
} from './utils/timing.server.ts'
import { WeatherExample } from './components/WeatherExample.tsx'
import { Weather } from './WeatherExample.js'
import { honeypot } from './utils/honeypot.server.ts'
import { combineHeaders, getDomainUrl, getUserImgSrc } from './utils/misc.tsx'
import { useNonce } from './utils/nonce-provider.ts'
Expand Down Expand Up @@ -138,15 +136,9 @@ export async function loader({ request }: LoaderFunctionArgs) {
// }
// const { toast, headers: toastHeaders } = await getToast(request)
const honeyProps = honeypot.getInputProps()
// Weather station data
const w_href: string =
'https://archive-api.open-meteo.com/v1/archive?latitude=52.52&longitude=13.41&daily=temperature_2m_max&timezone=America%2FNew_York&start_date=2022-01-01&end_date=2023-08-30&temperature_unit=fahrenheit'
const w_res: Response = await fetch(w_href)
const weather: Weather = (await w_res.json()) as Weather

return json(
{
weather,
user,
requestInfo: {
hints: getHints(request),
Expand Down
4 changes: 2 additions & 2 deletions heat-stack/app/routes/_heat+/Inputs1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const addressMaxLength = 100
const HomeInformationSchema = z.object({
name: z.string().min(1).max(nameMaxLength),
address: z.string().min(1).max(addressMaxLength),
livingArea: z.number().min(1),
living_area: z.number().min(1),
})

export async function action({ request, params }: ActionFunctionArgs) {
Expand Down Expand Up @@ -56,7 +56,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
// - [ ] Build form #2 and #3
// - [ ] Form errors (if we think of a use case - 2 fields conflicting...)

const { name, address, livingArea } = submission.value
const { name, address, living_area } = submission.value

// await updateNote({ id: params.noteId, title, content })

Expand Down
Loading
Loading