Skip to content

Commit

Permalink
Rename property
Browse files Browse the repository at this point in the history
  • Loading branch information
longzheng committed Dec 13, 2024
1 parent 1398cfb commit cdb9a2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/coordinator/helpers/inverterController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const defaultValues = {
} as const satisfies Record<ControlType, unknown>;

export class InverterController {
private activeLimitOutput: Publish;
private publish: Publish;
private cachedDerSample = new CappedArrayStack<DerSample>({ limit: 100 });
private cachedSiteSample = new CappedArrayStack<SiteSample>({ limit: 100 });
private logger: Logger;
Expand Down Expand Up @@ -107,7 +107,7 @@ export class InverterController {
inverterConfiguration: InverterConfiguration,
) => Promise<void>;
}) {
this.activeLimitOutput = new Publish({ config });
this.publish = new Publish({ config });
this.secondsToSample = config.inverterControl.sampleSeconds;
this.controlFrequencyMinimumSeconds =
config.inverterControl.controlFrequencyMinimumSeconds;
Expand Down Expand Up @@ -175,7 +175,7 @@ export class InverterController {

writeActiveControlLimit({ limit: activeInverterControlLimit });

this.activeLimitOutput.onActiveInverterControlLimit({
this.publish.onActiveInverterControlLimit({
limit: activeInverterControlLimit,
});

Expand Down
2 changes: 1 addition & 1 deletion src/coordinator/helpers/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type ActiveInverterControlLimit } from './inverterController.js';
export class Publish {
private mqtt: { client: mqtt.MqttClient; topic: string } | undefined;

constructor({ config }: { config: Config }) {
constructor({ config }: { config: Pick<Config, 'publish'> }) {
if (config.publish?.mqtt) {
this.mqtt = {
client: mqtt.connect(config.publish.mqtt.host, {
Expand Down

0 comments on commit cdb9a2d

Please sign in to comment.